LDAP work in progress
This commit is contained in:
parent
17260644bb
commit
d593d99a01
@ -54,7 +54,7 @@ public class LdapDAO {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
throw new TechnicalException(e);
|
throw new TechnicalException(e);
|
||||||
} finally {
|
} finally {
|
||||||
close();
|
disconnect();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -71,6 +71,7 @@ public class LdapDAO {
|
|||||||
tls = (StartTlsResponse) ctx.extendedOperation(new StartTlsRequest());
|
tls = (StartTlsResponse) ctx.extendedOperation(new StartTlsRequest());
|
||||||
final SSLContext sc = SSLContext.getInstance("TLSv1.2");
|
final SSLContext sc = SSLContext.getInstance("TLSv1.2");
|
||||||
final TrustManager tm = new X509TrustManager() {
|
final TrustManager tm = new X509TrustManager() {
|
||||||
|
// TODO trusts everybody
|
||||||
@Override
|
@Override
|
||||||
public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
|
public void checkClientTrusted(X509Certificate[] arg0, String arg1) throws CertificateException {
|
||||||
}
|
}
|
||||||
@ -96,7 +97,7 @@ public class LdapDAO {
|
|||||||
return ldapAttrs.get(attributeName).getAll().next().toString();
|
return ldapAttrs.get(attributeName).getAll().next().toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void close() {
|
private void disconnect() {
|
||||||
if (tls != null) {
|
if (tls != null) {
|
||||||
try {
|
try {
|
||||||
tls.close();
|
tls.close();
|
||||||
|
Loading…
Reference in New Issue
Block a user