mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

el_kaboing
19.27.2006 e05ed4d9d4ce0a6c80c1fbbf02fe5041e12c1a15
Fix for Issue 842 - An ldif file is generated during run time which is used to add the ldaps conenction handler.
The SSL port which is used is obtained from the config.py file and is defined by the user.
1 files added
1 files modified
41 ■■■■■ changed files
opendj-sdk/opends/tests/functional-tests/shared/functions/security.xml 7 ●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/functional-tests/shared/python/security.py 34 ●●●●● patch | view | raw | blame | history
opendj-sdk/opends/tests/functional-tests/shared/functions/security.xml
@@ -111,6 +111,9 @@
                  'result'     : STAXResult }
            </call>
        <!--- Modify the SSL port to the user-defined value -->
           <script>write_ldaps_ldif_file('%s' % (TMPDIR), '%s' % (DIRECTORY_INSTANCE_SSL_PORT));</script>
        <!--- Add LDAPS Connection Handler -->
            <message>
               'Adding LDAPS Connection Handler'
@@ -121,14 +124,14 @@
                'dsInstancePort'   : DIRECTORY_INSTANCE_PORT ,
                'dsInstanceDn'     : DIRECTORY_INSTANCE_DN ,
                'dsInstancePswd'   : DIRECTORY_INSTANCE_PSWD ,
                'entryToBeAdded'   : '%s/security/%s/setup/enable_ldaps_conn_handler.ldif' % (LDIF_DATA_DIR,keystoreType) }
                'entryToBeAdded'   : '%s/ldaps_port.ldif' % (TMPDIR) }
            </call>
            <call function="'checktestRC'">
                { 'returncode' : RC ,
                  'result'     : STAXResult }
            </call>
      </sequence>
    </function>
opendj-sdk/opends/tests/functional-tests/shared/python/security.py
New file
@@ -0,0 +1,34 @@
#! /usr/bin python
def write_ldaps_ldif_file(path, port):
    ldif_file = open("/tmp/ldaps_port.ldif","w")
    ldif_file.write("dn: cn=LDAPS Connection Handler,cn=Connection Handlers,cn=config\n")
    ldif_file.write("objectclass: top\n")
    ldif_file.write("objectclass: ds-cfg-connection-handler\n")
    ldif_file.write("objectclass: ds-cfg-ldap-connection-handler\n")
    ldif_file.write("cn: LDAPS Connection Handler\n")
    ldif_file.write("ds-cfg-connection-handler-class: org.opends.server.protocols.ldap.LDAPConnectionHandler\n")
    ldif_file.write("ds-cfg-connection-handler-enabled: true\n")
    ldif_file.write("ds-cfg-listen-address: 0.0.0.0\n")
    ldif_file.write("ds-cfg-listen-port: ")
    ldif_file.write(port)
    ldif_file.write("\n")
    ldif_file.write("ds-cfg-allow-ldapv2: true\n")
    ldif_file.write("ds-cfg-keep-stats: true\n")
    ldif_file.write("ds-cfg-use-tcp-keepalive: true\n")
    ldif_file.write("ds-cfg-use-tcp-nodelay: true\n")
    ldif_file.write("ds-cfg-allow-tcp-reuse-address: true\n")
    ldif_file.write("ds-cfg-send-rejection-notice: true\n")
    ldif_file.write("ds-cfg-max-request-size: 5 mb\n")
    ldif_file.write("ds-cfg-num-request-handlers: 2\n")
    ldif_file.write("ds-cfg-allow-start-tls: false\n")
    ldif_file.write("ds-cfg-use-ssl: true\n")
    ldif_file.write("ds-cfg-ssl-client-auth-policy: optional\n")
    ldif_file.write("ds-cfg-ssl-cert-nickname: server-cert\n")
    ldif_file.close()