[OPENDJ-2152] ldapsearch ignores ldapsearch.useSSL=true in a tools.properties Created: 18/Jun/15  Updated: 08/Nov/19  Resolved: 19/Jun/15

Status: Done
Project: OpenDJ
Component/s: tools
Affects Version/s: 2.6.2, 2.6.1, 2.6.0
Fix Version/s: 3.0.0

Type: Bug Priority: Minor
Reporter: Lee Trujillo Assignee: Chris Ridd
Resolution: Fixed Votes: 0
Labels: release-notes

Issue Links:
Backport
is backported by OPENDJ-2157 Backport OPENDJ-2152: ldapsearch igno... Done
Dev Assignee: Chris Ridd
Support Ticket IDs:

 Description   

When using ldapsearch with a tools.properties file, ldapsearch ignores useSSL=true while other commands such as ldapmodify & ldapdelete do not.

~/.opendj/tools.properties

ldapsearch.hostname=opendj.forgerock.com
ldapsearch.port=6636
ldapsearch.countEntries=true
ldapsearch.trustAll=true
ldapsearch.useSSL=true

ldapmodify.hostname=opendj.forgerock.com
ldapmodify.port=6636
ldapmodify.countEntries=true
ldapmodify.trustAll=true
ldapmodify.useSSL=true
ldapmodify.bindPassword=password

ldapdelete.hostname=opendj.forgerock.com
ldapdelete.port=6636
ldapdelete.countEntries=true
ldapdelete.trustAll=true
ldapdelete.useSSL=true
ldapdelete.bindPassword=password

TESTCASES:

ldapsearch:

bin/$ ./ldapsearch -T --baseDN cn=monitor --searchScope sub "(objectClass=*)"
Cannot read the bind response from the server. The port you are using may require a secured communication (--useSSL). The connection to the Directory Server was closed before the bind response could be read (id=10748693)
Result Code: 82 (Local Error)

[17/Jun/2015:16:34:26 -0600] CONNECT conn=71 from=192.168.0.11:60778 to=192.168.0.11:6636 protocol=LDAPS
[17/Jun/2015:16:34:26 -0600] DISCONNECT conn=71 reason="I/O Error" msg="An IO error occurred while reading a request from the client: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?"

ldapmodify:

bin/$ ./ldapmodify --defaultAdd
dn: uid=Squirrel,ou=People,dc=forgerock,dc=com
objectClass: person
objectClass: inetorgperson
objectClass: organizationalperson
objectClass: top
uid: Squirrel
givenName: Tree
cn: Tree Squirrel
sn: Squirrel

Processing ADD request for uid=Squirrel,ou=People,dc=forgerock,dc=com
ADD operation successful for DN uid=Squirrel,ou=People,dc=forgerock,dc=com

[17/Jun/2015:16:22:59 -0600] CONNECT conn=61 from=192.168.0.11:60660 to=192.168.0.11:6636 protocol=LDAPS
[17/Jun/2015:16:22:59 -0600] BIND REQ conn=61 op=0 msgID=1 version=3 type=SIMPLE dn="cn=Directory Manager"
[17/Jun/2015:16:22:59 -0600] BIND RES conn=61 op=0 msgID=1 result=0 authDN="cn=Directory Manager,cn=Root DNs,cn=config" etime=0
[17/Jun/2015:16:23:17 -0600] ADD REQ conn=61 op=1 msgID=2 dn="uid=Squirrel,ou=People,dc=forgerock,dc=com"
[17/Jun/2015:16:23:17 -0600] ADD RES conn=61 op=1 msgID=2 result=0 etime=33
[17/Jun/2015:16:25:13 -0600] UNBIND REQ conn=61 op=2 msgID=3
[17/Jun/2015:16:25:13 -0600] DISCONNECT conn=61 reason="Client Unbind"

ldapdelete:

bin/$ ldapdelete --filename ./todelete
Processing DELETE request for uid=Squirrel,ou=People,dc=forgerock,dc=com
DELETE operation successful for DN uid=Squirrel,ou=People,dc=forgerock,dc=com

[17/Jun/2015:16:33:39 -0600] CONNECT conn=70 from=192.168.0.11:60776 to=192.168.0.11:6636 protocol=LDAPS
[17/Jun/2015:16:33:39 -0600] BIND REQ conn=70 op=0 msgID=1 version=3 type=SIMPLE dn="cn=Directory Manager"
[17/Jun/2015:16:33:39 -0600] BIND RES conn=70 op=0 msgID=1 result=0 authDN="cn=Directory Manager,cn=Root DNs,cn=config" etime=1
[17/Jun/2015:16:33:39 -0600] DELETE REQ conn=70 op=1 msgID=2 dn="uid=Squirrel,ou=People,dc=forgerock,dc=com"
[17/Jun/2015:16:33:39 -0600] DELETE RES conn=70 op=1 msgID=2 result=0 etime=15
[17/Jun/2015:16:33:39 -0600] UNBIND REQ conn=70 op=2 msgID=3
[17/Jun/2015:16:33:39 -0600] DISCONNECT conn=70 reason="Client Unbind"



 Comments   
Comment by Chris Ridd [ 18/Jun/15 ]

It appears to be due to this typo in LDAPSearch.java:

      subEntriesArgument = new BooleanArgument("subEntries",
              OPTION_SHORT_SUBENTRIES, OPTION_LONG_SUBENTRIES,
              INFO_DESCRIPTION_SUBENTRIES.get());
      useSSL.setPropertyName(OPTION_LONG_SUBENTRIES);
      argParser.addArgument(subEntriesArgument);

It should be:

      subEntriesArgument.setPropertyName(OPTION_LONG_SUBENTRIES);
Comment by Matthew Swift [ 07/Nov/19 ]

Moved to closed state because the fixVersion has already been released.

Generated at Fri Oct 23 09:09:26 UTC 2020 using Jira 7.13.12#713012-sha1:6e07c38070d5191bbf7353952ed38f111754533a.