SSLSession session = tls.negotiate(new org.jivesoftware.util.SimpleSSLSocketFactory());
@Override public void close() throws KettleException { if ( startTlsResponse != null ) { try { startTlsResponse.close(); } catch ( IOException e ) { throw new KettleException( e ); } finally { startTlsResponse = null; } } super.close(); } }
/** * This will attempt the startTLS extended operation on the supplied ldap context. * * @param ctx ldap context * * @return start tls response * * @throws NamingException if an error occurs while requesting an extended operation * @throws IOException if an error occurs while negotiating TLS */ protected StartTlsResponse startTLS(final LdapContext ctx) throws NamingException, IOException { final StartTlsResponse tls = (StartTlsResponse) ctx.extendedOperation(new StartTlsRequest()); if (hostnameVerifier != null) { logger.trace("startTLS hostnameVerifier = {}", hostnameVerifier); tls.setHostnameVerifier(hostnameVerifier); } if (sslSocketFactory != null) { logger.trace("startTLS sslSocketFactory = {}", sslSocketFactory); tls.negotiate(sslSocketFactory); } else { tls.negotiate(); } return tls; }
.extendedOperation(new StartTlsRequest()); if (getHostnameVerifier() != null) { tls.setHostnameVerifier(getHostnameVerifier()); tls.setEnabledCipherSuites(getCipherSuitesArray()); SSLSession negotiate = tls.negotiate(getSSLSocketFactory()); containerLog.debug(sm.getString("jndiRealm.negotiatedTls", negotiate.getProtocol()));
/** * This will attempt the startTLS extended operation on the supplied ldap context. * * @param ctx ldap context * * @return start tls response * * @throws NamingException if an error occurs while requesting an extended operation * @throws IOException if an error occurs while negotiating TLS */ protected StartTlsResponse startTLS(final LdapContext ctx) throws NamingException, IOException { final StartTlsResponse tls = (StartTlsResponse) ctx.extendedOperation(new StartTlsRequest()); if (hostnameVerifier != null) { logger.trace("startTLS hostnameVerifier = {}", hostnameVerifier); tls.setHostnameVerifier(hostnameVerifier); } if (sslSocketFactory != null) { logger.trace("startTLS sslSocketFactory = {}", sslSocketFactory); tls.negotiate(sslSocketFactory); } else { tls.negotiate(); } return tls; }
.extendedOperation(new StartTlsRequest()); if (getHostnameVerifier() != null) { tls.setHostnameVerifier(getHostnameVerifier()); tls.setEnabledCipherSuites(getCipherSuitesArray()); SSLSession negotiate = tls.negotiate(getSSLSocketFactory()); containerLog.debug(sm.getString("jndiRealm.negotiatedTls", negotiate.getProtocol()));
/** * This will attempt the startTLS extended operation on the supplied ldap context. * * @param ctx ldap context * * @return start tls response * * @throws NamingException if an error occurs while requesting an extended operation * @throws IOException if an error occurs while negotiating TLS */ protected StartTlsResponse startTLS(final LdapContext ctx) throws NamingException, IOException { final StartTlsResponse tls = (StartTlsResponse) ctx.extendedOperation(new StartTlsRequest()); if (hostnameVerifier != null) { logger.trace("startTLS hostnameVerifier = {}", hostnameVerifier); tls.setHostnameVerifier(hostnameVerifier); } if (sslSocketFactory != null) { logger.trace("startTLS sslSocketFactory = {}", sslSocketFactory); tls.negotiate(sslSocketFactory); } else { tls.negotiate(); } return tls; }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (method.getName().equals(CLOSE_METHOD_NAME)) { tlsResponse.close(); return method.invoke(target, args); } else if (method.getName().equals(GET_TARGET_CONTEXT_METHOD_NAME)) { return target; } else { return method.invoke(target, args); } } }
tls = (StartTlsResponse) delegate .extendedOperation(new StartTlsRequest()); tls.setHostnameVerifier(new HostnameVerifier() { final SSLSession negotiate = tls.negotiate(); Logger.getLogger(this.getClass().getCanonicalName()).fine( "LDAP is now using " + negotiate.getProtocol());
@Override protected void doConnect( String username, String password ) throws KettleException { super.doConnect( username, password ); StartTlsRequest tlsRequest = new StartTlsRequest(); try { this.startTlsResponse = (StartTlsResponse) getCtx().extendedOperation( tlsRequest ); /* Starting TLS */ this.startTlsResponse.negotiate( CustomSocketFactory.getDefault() ); } catch ( NamingException e ) { throw new KettleException( e ); } catch ( IOException e ) { throw new KettleException( e ); } }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (method.getName().equals(CLOSE_METHOD_NAME)) { tlsResponse.close(); return method.invoke(target, args); } else if (method.getName().equals(GET_TARGET_CONTEXT_METHOD_NAME)) { return target; } else { return method.invoke(target, args); } } }
try { if (hostnameVerifier != null) { tlsResponse.setHostnameVerifier(hostnameVerifier); tlsResponse.negotiate(sslSocketFactory); // If null, the default SSL socket factory is used applyAuthentication(ldapCtx, userDn, password);
public AutoclosingLdapContext(Hashtable<?, ?> environment, TlsOption negotiateTls) throws IOException, NamingException { super(environment, null); switch (negotiateTls) { case ATTEMPT: try { tls = (StartTlsResponse) this.extendedOperation(new StartTlsRequest()); tls.negotiate(); } catch (Exception err) { LOGGER.info("Could not negotiate TLS", err); } break; case STRICT: tls = (StartTlsResponse) this.extendedOperation(new StartTlsRequest()); tls.negotiate(); break; case NONE: break; } }
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { if (method.getName().equals(CLOSE_METHOD_NAME)) { tlsResponse.close(); return method.invoke(target, args); } else if (method.getName().equals(GET_TARGET_CONTEXT_METHOD_NAME)) { return target; } else { return method.invoke(target, args); } } }
try { if (hostnameVerifier != null) { tlsResponse.setHostnameVerifier(hostnameVerifier); tlsResponse.negotiate(sslSocketFactory); // If null, the default SSL socket factory is used applyAuthentication(ldapCtx, userDn, password);
SSLSession session = tls.negotiate(new org.jivesoftware.util.SimpleSSLSocketFactory());