I'm trying to use AsyncHttpClient + netty to POST to a HTTPS url (
https://www.trademonster.com) , and I"m getting a mysterious "ClosedChannelException", but I'm really thinking its some sort of SSL error. I noticed that if I set 'setAcceptAnyCertificate" on the AsyncHttpClientConfig object, it connects fine, but without it it gets this exception.
I checked the java certificate store and it seems that it has the root CA that the certificate uses (Godaddy, godaddyrootg2ca, Jul 18, 2014, trustedCertEntry, Certificate fingerprint (SHA1): 47:BE:AB:C9:22:EA:E8:0E:78:78:34:62:A7:9F:45:C2:54:FD:E6:8B ), so I'm not sure why it can't successfully connect to this website when python+requests, firefox, chrome all can.
Full console log with -Djavax.net.debug="all":
https://gist.github.com/anonymous/e3e3eb4238788baf5283The exception text is here:
17:31:49 [Thread-3] ERROR c.s.s.AHCSession - Caught exception when trying to execute a http request: com.ning.http.client.AsyncHttpClient$BoundRequestBuilder@42aa444c
java.util.concurrent.ExecutionException: java.net.ConnectException:
https://www.trademonster.com:443 at com.ning.http.client.providers.netty.future.NettyResponseFuture.abort(NettyResponseFuture.java:231) ~[async-http-client-1.9.27.jar:na]
at com.ning.http.client.providers.netty.request.NettyConnectListener.onFutureFailure(NettyConnectListener.java:135) ~[async-http-client-1.9.27.jar:na]
at com.ning.http.client.providers.netty.request.NettyConnectListener.access$200(NettyConnectListener.java:37) ~[async-http-client-1.9.27.jar:na]
at com.ning.http.client.providers.netty.request.NettyConnectListener$1.operationComplete(NettyConnectListener.java:104) ~[async-http-client-1.9.27.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:409) ~[netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListeners(DefaultChannelFuture.java:395) ~[netty-3.10.4.Final.jar:na]
Caused by: java.net.ConnectException:
https://www.trademonster.com:443 at com.ning.http.client.providers.netty.request.NettyConnectListener.onFutureFailure(NettyConnectListener.java:131) ~[async-http-client-1.9.27.jar:na]
at com.ning.http.client.providers.netty.request.NettyConnectListener.access$200(NettyConnectListener.java:37) ~[async-http-client-1.9.27.jar:na]
at com.ning.http.client.providers.netty.request.NettyConnectListener$1.operationComplete(NettyConnectListener.java:104) ~[async-http-client-1.9.27.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListener(DefaultChannelFuture.java:409) ~[netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.notifyListeners(DefaultChannelFuture.java:395) ~[netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelFuture.setFailure(DefaultChannelFuture.java:362) ~[netty-3.10.4.Final.jar:na]
Caused by: java.nio.channels.ClosedChannelException: null
at org.jboss.netty.handler.ssl.SslHandler.channelDisconnected(SslHandler.java:575) ~[netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream(SimpleChannelUpstreamHandler.java:102) ~[netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564) ~[netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:559) ~[netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.Channels.fireChannelDisconnected(Channels.java:396) ~[netty-3.10.4.Final.jar:na]
at org.jboss.netty.channel.socket.nio.AbstractNioWorker.close(AbstractNioWorker.java:360) ~[netty-3.10.4.Final.jar:na]