Skip to content

Commit 028ede3

Browse files
author
Stephane Landelle
committed
Don't depend on cache key for determining if ssl, close AsyncHttpClient#690
1 parent 8994e5a commit 028ede3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/pool/DefaultChannelPool.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
import static org.asynchttpclient.util.DateUtils.millisTime;
1717
import io.netty.channel.Channel;
18+
import io.netty.handler.ssl.SslHandler;
1819
import io.netty.util.Timeout;
1920
import io.netty.util.Timer;
2021
import io.netty.util.TimerTask;
@@ -242,7 +243,7 @@ private ConcurrentLinkedQueue<IdleChannel> getPoolForKey(String key) {
242243
* {@inheritDoc}
243244
*/
244245
public boolean offer(Channel channel, String poolKey) {
245-
if (isClosed.get() || (!sslConnectionPoolEnabled && poolKey.startsWith("https")))
246+
if (isClosed.get() || (!sslConnectionPoolEnabled && channel.pipeline().get(SslHandler.class) != null))
246247
return false;
247248

248249
long now = millisTime();

0 commit comments

Comments
 (0)