Commit 99de4bd3 authored by speedy01's avatar speedy01

OF-332 ldap.connect.timeout not working with SSL connection

parent 9a6eedcb
...@@ -646,14 +646,14 @@ public class LdapManager { ...@@ -646,14 +646,14 @@ public class LdapManager {
} }
} }
// Set only on non SSL since SSL connections break with a timeout.
if (!sslEnabled) {
if (connTimeout > 0) { if (connTimeout > 0) {
env.put("com.sun.jndi.ldap.connect.timeout", String.valueOf(connTimeout)); env.put("com.sun.jndi.ldap.connect.timeout", String.valueOf(connTimeout));
} else { } else {
env.put("com.sun.jndi.ldap.connect.timeout", "10000"); env.put("com.sun.jndi.ldap.connect.timeout", "10000");
} }
}
if (readTimeout > 0) { if (readTimeout > 0) {
env.put("com.sun.jndi.ldap.read.timeout", String.valueOf(readTimeout)); env.put("com.sun.jndi.ldap.read.timeout", String.valueOf(readTimeout));
} }
...@@ -746,11 +746,9 @@ public class LdapManager { ...@@ -746,11 +746,9 @@ public class LdapManager {
env.put(Context.SECURITY_PRINCIPAL, userDN + "," + alternateBaseDN); env.put(Context.SECURITY_PRINCIPAL, userDN + "," + alternateBaseDN);
env.put(Context.SECURITY_CREDENTIALS, password); env.put(Context.SECURITY_CREDENTIALS, password);
} }
// Specify timeout to be 10 seconds, only on non SSL since SSL connections
// break with a timemout.
if (!sslEnabled) {
env.put("com.sun.jndi.ldap.connect.timeout", "10000"); env.put("com.sun.jndi.ldap.connect.timeout", "10000");
}
if (ldapDebugEnabled) { if (ldapDebugEnabled) {
env.put("com.sun.jndi.ldap.trace.ber", System.err); env.put("com.sun.jndi.ldap.trace.ber", System.err);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment