Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ability to add 'host_name' extension for SNI in netty #5218

Closed
gollapa opened this issue Dec 18, 2022 · 1 comment · Fixed by #5241
Closed

ability to add 'host_name' extension for SNI in netty #5218

gollapa opened this issue Dec 18, 2022 · 1 comment · Fixed by #5241
Assignees

Comments

@gollapa
Copy link

gollapa commented Dec 18, 2022

When making oubound rest calls we have a requirement to use the NAT IP address instead of the actual host name. When making such calls for SNI enabled servers currently we would need a provision to set server_name in the request for the TLS /SSL handshake to pass.

Currently if the request is made using IP address server_name is not passed in the extension.

An ability to use the HOST name header to inject host_name in the SNI extension can be evaluated as follows . Currently the SNI is derived from the request uri as requestUri.getHost() in NettyConnector.

Following code resolved setting Sni using host name header set in the request:

if((nettyRequest.headers().contains("Host"))) {
hdr = nettyRequest.headers().get(HttpHeaderNames.HOST);
}
SslHandler sslHandler = jdkSslContext.newHandler(ch.alloc(),hdr==null? requestUri.getHost():hdr,
(port <= 0) ? 443 : port, NettyConnector.this.executorService);

@jansupol jansupol added the netty label Dec 20, 2022
@gollapa
Copy link
Author

gollapa commented Dec 29, 2022

any update?we are using jersey with netty connector version 2.37

@jansupol jansupol self-assigned this Jan 20, 2023
@jansupol jansupol linked a pull request Jan 31, 2023 that will close this issue
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants