SSL Proxy using http 1.0 ?

79 views
Skip to first unread message

Luc Van Hoeylandt

unread,
May 26, 2015, 10:32:44 AM5/26/15
to asyncht...@googlegroups.com
Hi,

I am using the http async client to make REST calls over http and https both using a proxy; 
Http works like expected. Https seems to fail because the other end needs HTTP/1.1 support (thus sending me a 505 error) and the library only seems send a 1.0 request. Is there way to force HTTP/1.1 when taking to the proxy ? Or am I missing something obvious...

Thanks,

Luc


Stéphane LANDELLE

unread,
May 26, 2015, 10:56:09 AM5/26/15
to asyncht...@googlegroups.com
Hi,

It seems it was originally intended to cope with proxies mostly supporting HTTP/1.0.
In 2015, I'm not sure that's still the case.

I made the behavior configuration on the ProxyServer class, and changed the default to HTTP/1.1.

Thanks for reporting!

Stéphane Landelle
Lead developer


--
You received this message because you are subscribed to the Google Groups "asynchttpclient" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asynchttpclie...@googlegroups.com.
To post to this group, send email to asyncht...@googlegroups.com.
Visit this group at http://groups.google.com/group/asynchttpclient.
For more options, visit https://groups.google.com/d/optout.

Luc Van Hoeylandt

unread,
May 27, 2015, 4:42:55 AM5/27/15
to asyncht...@googlegroups.com
Hi Stéphane,

Thanks for the quick patch, now I am stuck at hostname verification...

Exception in thread "main" java.lang.IllegalArgumentException: no HostnameVerifier specified

I'm guessing the SSL connection to the proxy is being denied because the certificate is self-signed and/or the hostname does not match.
Note that SSL requests without the proxy work when setAcceptAnyCertificate is set to true). Any way to work around this ?

Thanks,

Luc

Stéphane LANDELLE

unread,
May 27, 2015, 6:04:07 AM5/27/15
to asyncht...@googlegroups.com
Hi,

What's the full stacktrace, please?

Stéphane Landelle
Lead developer


Luc Van Hoeylandt

unread,
May 27, 2015, 7:22:14 AM5/27/15
to asyncht...@googlegroups.com
Hi,

Full stacktrace:

Exception in thread "main" java.lang.IllegalArgumentException: no HostnameVerifier specified
at javax.net.ssl.HttpsURLConnection.setHostnameVerifier(HttpsURLConnection.java:265)
at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.createUrlConnection(JDKAsyncHttpProvider.java:192)
at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(JDKAsyncHttpProvider.java:147)
at com.ning.http.client.providers.jdk.JDKAsyncHttpProvider.execute(JDKAsyncHttpProvider.java:118)
at com.ning.http.client.AsyncHttpClient.executeRequest(AsyncHttpClient.java:506)

Seems I had removed netty 3 from my jar; when using netty this issue does not occur

Running 
$ java -version
java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)


Regards,

Luc

Stéphane LANDELLE

unread,
May 27, 2015, 7:49:52 AM5/27/15
to asyncht...@googlegroups.com
OK, so forget about the JDK provider that's just a toy and is going away in AHC2.
User a real one such as Netty or Grizzly.

Stéphane Landelle
Lead developer


Reply all
Reply to author
Forward
0 new messages