use of org.eclipse.jetty.io.ssl.SslConnection.DecryptedEndPoint in project jetty.project by eclipse.
the class SocketCustomizationListener method onOpened.
@Override
public void onOpened(Connection connection) {
EndPoint endp = connection.getEndPoint();
boolean ssl = false;
if (_ssl && endp instanceof DecryptedEndPoint) {
endp = ((DecryptedEndPoint) endp).getSslConnection().getEndPoint();
ssl = true;
}
if (endp instanceof SocketChannelEndPoint) {
Socket socket = ((SocketChannelEndPoint) endp).getSocket();
customize(socket, connection.getClass(), ssl);
}
}
use of org.eclipse.jetty.io.ssl.SslConnection.DecryptedEndPoint in project jetty.project by eclipse.
the class SecureRequestCustomizer method customize.
@Override
public void customize(Connector connector, HttpConfiguration channelConfig, Request request) {
EndPoint endp = request.getHttpChannel().getEndPoint();
if (endp instanceof DecryptedEndPoint) {
SslConnection.DecryptedEndPoint ssl_endp = (DecryptedEndPoint) endp;
SslConnection sslConnection = ssl_endp.getSslConnection();
SSLEngine sslEngine = sslConnection.getSSLEngine();
customize(sslEngine, request);
if (request.getHttpURI().getScheme() == null)
request.setScheme(HttpScheme.HTTPS.asString());
} else if (endp instanceof ProxyConnectionFactory.ProxyEndPoint) {
ProxyConnectionFactory.ProxyEndPoint proxy = (ProxyConnectionFactory.ProxyEndPoint) endp;
if (request.getHttpURI().getScheme() == null && proxy.getAttribute(ProxyConnectionFactory.TLS_VERSION) != null)
request.setScheme(HttpScheme.HTTPS.asString());
}
if (HttpScheme.HTTPS.is(request.getScheme()))
customizeSecure(request);
}
Aggregations