@Override public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException { String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY); int port = (Integer)context.get(SSL_PEER_PORT_CONTEXT_KEY); SSLEngine engine = sslContextFactory.newSSLEngine(host, port); engine.setUseClientMode(true); context.put(SSL_ENGINE_CONTEXT_KEY, engine); SslConnection sslConnection = newSslConnection(byteBufferPool, executor, endPoint, engine); endPoint.setConnection(sslConnection); EndPoint appEndPoint = sslConnection.getDecryptedEndPoint(); appEndPoint.setConnection(connectionFactory.newConnection(appEndPoint, context)); customize(sslConnection, context); return sslConnection; }
protected ClientConnectionFactory newSslClientConnectionFactory(SslContextFactory sslContextFactory, ClientConnectionFactory connectionFactory) { return new SslClientConnectionFactory(sslContextFactory, getByteBufferPool(), getExecutor(), connectionFactory); }
protected SslConnection newSslConnection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, SSLEngine engine) { return new SslConnection(byteBufferPool, executor, endPoint, engine, isDirectBuffersForEncryption(), isDirectBuffersForDecryption()); }
@Override public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException { String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY); int port = (Integer)context.get(SSL_PEER_PORT_CONTEXT_KEY); SSLEngine engine = sslContextFactory.newSSLEngine(host, port); engine.setUseClientMode(true); context.put(SSL_ENGINE_CONTEXT_KEY, engine); SslConnection sslConnection = newSslConnection(byteBufferPool, executor, endPoint, engine); sslConnection.setRenegotiationAllowed(sslContextFactory.isRenegotiationAllowed()); endPoint.setConnection(sslConnection); EndPoint appEndPoint = sslConnection.getDecryptedEndPoint(); appEndPoint.setConnection(connectionFactory.newConnection(appEndPoint, context)); return sslConnection; }
@Override public Connection customize(Connection connection, Map<String, Object> context) { if (connection instanceof SslConnection) { SslConnection sslConnection = (SslConnection)connection; sslConnection.setRenegotiationAllowed(sslContextFactory.isRenegotiationAllowed()); sslConnection.setRenegotiationLimit(sslContextFactory.getRenegotiationLimit()); sslConnection.setAllowMissingCloseMessage(isAllowMissingCloseMessage()); ContainerLifeCycle connector = (ContainerLifeCycle)context.get(ClientConnectionFactory.CONNECTOR_CONTEXT_KEY); connector.getBeans(SslHandshakeListener.class).forEach(sslConnection::addHandshakeListener); } return ClientConnectionFactory.super.customize(connection, context); } }
@Override public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException { String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY); int port = (Integer)context.get(SSL_PEER_PORT_CONTEXT_KEY); SSLEngine engine = sslContextFactory.newSSLEngine(host, port); engine.setUseClientMode(true); context.put(SSL_ENGINE_CONTEXT_KEY, engine); SslConnection sslConnection = newSslConnection(byteBufferPool, executor, endPoint, engine); sslConnection.setRenegotiationAllowed(sslContextFactory.isRenegotiationAllowed()); endPoint.setConnection(sslConnection); EndPoint appEndPoint = sslConnection.getDecryptedEndPoint(); appEndPoint.setConnection(connectionFactory.newConnection(appEndPoint, context)); return sslConnection; }
@Override public Connection customize(Connection connection, Map<String, Object> context) { if (connection instanceof SslConnection) { SslConnection sslConnection = (SslConnection)connection; sslConnection.setRenegotiationAllowed(sslContextFactory.isRenegotiationAllowed()); sslConnection.setRenegotiationLimit(sslContextFactory.getRenegotiationLimit()); sslConnection.setAllowMissingCloseMessage(isAllowMissingCloseMessage()); ContainerLifeCycle connector = (ContainerLifeCycle)context.get(ClientConnectionFactory.CONNECTOR_CONTEXT_KEY); connector.getBeans(SslHandshakeListener.class).forEach(sslConnection::addHandshakeListener); } return ClientConnectionFactory.super.customize(connection, context); } }
@Override public org.eclipse.jetty.io.Connection newConnection(EndPoint endPoint, Map<String, Object> context) throws IOException { String host = (String)context.get(SSL_PEER_HOST_CONTEXT_KEY); int port = (Integer)context.get(SSL_PEER_PORT_CONTEXT_KEY); SSLEngine engine = sslContextFactory.newSSLEngine(host, port); engine.setUseClientMode(true); context.put(SSL_ENGINE_CONTEXT_KEY, engine); SslConnection sslConnection = newSslConnection(byteBufferPool, executor, endPoint, engine); endPoint.setConnection(sslConnection); EndPoint appEndPoint = sslConnection.getDecryptedEndPoint(); appEndPoint.setConnection(connectionFactory.newConnection(appEndPoint, context)); customize(sslConnection, context); return sslConnection; }
protected SslConnection newSslConnection(ByteBufferPool byteBufferPool, Executor executor, EndPoint endPoint, SSLEngine engine) { return new SslConnection(byteBufferPool, executor, endPoint, engine, isDirectBuffersForEncryption(), isDirectBuffersForDecryption()); }
protected ClientConnectionFactory newSslClientConnectionFactory(ClientConnectionFactory connectionFactory) { return new SslClientConnectionFactory(getSslContextFactory(), getByteBufferPool(), getExecutor(), connectionFactory); }
public SPDYClient newSPDYClient(short version, NegotiatingClientConnectionFactory negotiatingFactory) { SPDYClient client = new SPDYClient(version, this); ClientConnectionFactory connectionFactory = negotiatingFactory.getClientConnectionFactory(); if (sslContextFactory != null) connectionFactory = new SslClientConnectionFactory(getSslContextFactory(), getByteBufferPool(), getExecutor(), negotiatingFactory); client.setClientConnectionFactory(connectionFactory); return client; }