Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd0c2ebe

Browse files
committed
Don't stall when failing to create SslHandler,closeAsyncHttpClient#1361
Motivation:Creating a SslHandler can crash, for example when there's a typo in theenabled protocols.When this happens, the exception is not propagated.Modification:Catch such Exception and notify the NettyConnectListener.Result:AHC no longer stalled when such exception happens.
1 parent1c4ed72 commitd0c2ebe

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

‎client/src/main/java/org/asynchttpclient/netty/channel/NettyConnectListener.java‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,13 @@ public void onSuccess(Channel channel, InetSocketAddress remoteAddress) {
110110

111111
// in case of proxy tunneling, we'll add the SslHandler later, after the CONNECT request
112112
if (future.getProxyServer() ==null &&uri.isSecured()) {
113-
SslHandlersslHandler =channelManager.addSslHandler(channel.pipeline(),uri,request.getVirtualHost());
113+
SslHandlersslHandler =null;
114+
try {
115+
sslHandler =channelManager.addSslHandler(channel.pipeline(),uri,request.getVirtualHost());
116+
}catch (ExceptionsslError) {
117+
NettyConnectListener.this.onFailure(channel,sslError);
118+
return;
119+
}
114120

115121
finalAsyncHandlerExtensionsasyncHandlerExtensions =toAsyncHandlerExtensions(future.getAsyncHandler());
116122

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp