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

Matthew Swift
12.38.2011 3af0b06b4cb3c16c04a705f5f0c5a8e12c92ce4d
Issue OPENDJ-262: Implement pass through authentication (PTA)

Avoid NPE if no trust manager has been configured (i.e. when the default JVM trust manager is to be used).
1 files modified
17 ■■■■■ changed files
opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java 17 ●●●●● patch | view | raw | blame | history
opends/src/server/org/opends/server/extensions/LDAPPassThroughAuthenticationPolicyFactory.java
@@ -638,15 +638,18 @@
          if (options.isUseSSL())
          {
            // Obtain the configured trust manager which will be used in order
            // to determine the trust of the remote LDAP server.
            DN trustManagerDN = options.getTrustManagerProviderDN();
            TrustManagerProvider<?> trustManagerProvider = DirectoryServer
                .getTrustManagerProvider(trustManagerDN);
            // Obtain the optional configured trust manager which will be used
            // in order to determine the trust of the remote LDAP server.
            TrustManager[] tm = null;
            if (trustManagerProvider != null)
            DN trustManagerDN = options.getTrustManagerProviderDN();
            if (trustManagerDN != null)
            {
              tm = trustManagerProvider.getTrustManagers();
              TrustManagerProvider<?> trustManagerProvider = DirectoryServer
                  .getTrustManagerProvider(trustManagerDN);
              if (trustManagerProvider != null)
              {
                tm = trustManagerProvider.getTrustManagers();
              }
            }
            // Create the SSL context and initialize it.