/** * {@inheritDoc} */ @Override() public StartTLSExtendedRequest duplicate(final Control[] controls) { try { final StartTLSExtendedRequest r = new StartTLSExtendedRequest(sslSocketFactory, controls); r.setResponseTimeoutMillis(getResponseTimeoutMillis(null)); return r; } catch (Exception e) { // This should never happen, since an exception should only be thrown if // there is no SSL context, but this instance already has a context. debugException(e); return null; } }
/** * {@inheritDoc} */ @Override() public StartTLSExtendedRequest duplicate() { return duplicate(getControls()); }
public LDAPConnection buildLdapConnection() throws GeneralSecurityException, LDAPException { final LDAPConnection ldapConnection = new LDAPConnection(ldapProperties.getHost(), ldapProperties.getPort()); ldapConnection.processExtendedOperation(new StartTLSExtendedRequest(SSL_UTIL.createSSLContext())); return ldapConnection; }
/** * {@inheritDoc} */ public void processPreAuthenticatedConnection(final LDAPConnection connection) throws LDAPException { final StartTLSExtendedRequest startTLSRequest; if (sslContext == null) { startTLSRequest = new StartTLSExtendedRequest(sslSocketFactory); } else { startTLSRequest = new StartTLSExtendedRequest(sslContext); } // Since the StartTLS processing will occur during the course of // establishing the connection for use in the pool, set the connect timeout // for the operation to be equal to the connect timeout from the connection // options. final LDAPConnectionOptions opts = connection.getConnectionOptions(); startTLSRequest.setResponseTimeoutMillis(opts.getConnectTimeoutMillis()); final ExtendedResult r = connection.processExtendedOperation(startTLSRequest); if (! r.getResultCode().equals(ResultCode.SUCCESS)) { throw new LDAPExtendedOperationException(r); } }
/** * {@inheritDoc} */ @Override() public void toString(final StringBuilder buffer) { buffer.append("StartTLSExtendedRequest("); final Control[] controls = getControls(); if (controls.length > 0) { buffer.append("controls={"); for (int i=0; i < controls.length; i++) { if (i > 0) { buffer.append(", "); } buffer.append(controls[i]); } buffer.append('}'); } buffer.append(')'); } }
SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager()); ExtendedResult extendedResult = conn.processExtendedOperation( new StartTLSExtendedRequest(sslUtil.createSSLContext())); if (extendedResult.getResultCode() != ResultCode.SUCCESS) { throw new LDAPException(extendedResult.getResultCode());
/** * {@inheritDoc} */ public void processPreAuthenticatedConnection(final LDAPConnection connection) throws LDAPException { final StartTLSExtendedRequest startTLSRequest; if (sslContext == null) { startTLSRequest = new StartTLSExtendedRequest(sslSocketFactory); } else { startTLSRequest = new StartTLSExtendedRequest(sslContext); } // Since the StartTLS processing will occur during the course of // establishing the connection for use in the pool, set the connect timeout // for the operation to be equal to the connect timeout from the connection // options. final LDAPConnectionOptions opts = connection.getConnectionOptions(); startTLSRequest.setResponseTimeoutMillis(opts.getConnectTimeoutMillis()); final ExtendedResult r = connection.processExtendedOperation(startTLSRequest); if (! r.getResultCode().equals(ResultCode.SUCCESS)) { throw new LDAPExtendedOperationException(r); } }
/** * {@inheritDoc} */ @Override() public void toString(final StringBuilder buffer) { buffer.append("StartTLSExtendedRequest("); final Control[] controls = getControls(); if (controls.length > 0) { buffer.append("controls={"); for (int i=0; i < controls.length; i++) { if (i > 0) { buffer.append(", "); } buffer.append(controls[i]); } buffer.append('}'); } buffer.append(')'); } }
SSLUtil sslUtil = new SSLUtil(new TrustAllTrustManager()); ExtendedResult extendedResult = conn.processExtendedOperation( new StartTLSExtendedRequest(sslUtil.createSSLContext())); if (extendedResult.getResultCode() != ResultCode.SUCCESS) { throw new LDAPException(extendedResult.getResultCode());
/** * {@inheritDoc} */ @Override() public StartTLSExtendedRequest duplicate(final Control[] controls) { try { final StartTLSExtendedRequest r = new StartTLSExtendedRequest(sslSocketFactory, controls); r.setResponseTimeoutMillis(getResponseTimeoutMillis(null)); return r; } catch (Exception e) { // This should never happen, since an exception should only be thrown if // there is no SSL context, but this instance already has a context. debugException(e); return null; } }
/** * {@inheritDoc} */ @Override() public StartTLSExtendedRequest duplicate() { return duplicate(getControls()); }
SSLUtil sslUtil = new SSLUtil(); SSLContext context = sslUtil.createSSLContext(); ExtendedRequest extRequest = new StartTLSExtendedRequest(context);
ExtendedRequest extRequest = new StartTLSExtendedRequest(sslContext); extResult = con.processExtendedOperation(extRequest);
new StartTLSExtendedRequest(startTLSSocketFactory)); if (! extendedResult.getResultCode().equals(ResultCode.SUCCESS))
connection.processExtendedOperation(new StartTLSExtendedRequest( startTLSSocketFactory[serverIndex])); if (! extendedResult.getResultCode().equals(ResultCode.SUCCESS))
new StartTLSExtendedRequest(sslUtil.createSSLContext())); if (startTLSResult.getResultCode() != ResultCode.SUCCESS)
new StartTLSExtendedRequest(new ExtendedRequest(request.getOID(), request.getValue()));