You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Vikram (JIRA)" <ji...@apache.org> on 2014/03/14 13:32:42 UTC

[jira] [Reopened] (HTTPCLIENT-1481) Http Proxy with SSL target not working

     [ https://issues.apache.org/jira/browse/HTTPCLIENT-1481?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vikram reopened HTTPCLIENT-1481:
--------------------------------


Downloaded httpclient 4.3.3, i suppose this would be the latest.

Ran the example code in "ClientExecuteProxy.java". Just replaced the target value from "localhost" to "issues.apache.org".

Test 1 - Commented the proxy bit. The example ran successfully.
Test 2 - Uncommented the proxy part, failed with the same error as in 4.0.1. So i don't think this is something to do with the latest version.

Getting the following exception in console when i run it,
Executing request GET / HTTP/1.1 to https://issues.apache.org:443 via http://127.0.0.1:8080
Mar 14, 2014 5:56:05 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {tls}->http://127.0.0.1:8080->https://issues.apache.org:443: The target server failed to respond
Mar 14, 2014 5:56:05 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {tls}->http://127.0.0.1:8080->https://issues.apache.org:443
Mar 14, 2014 5:56:06 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {tls}->http://127.0.0.1:8080->https://issues.apache.org:443: The target server failed to respond
Mar 14, 2014 5:56:06 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {tls}->http://127.0.0.1:8080->https://issues.apache.org:443
Mar 14, 2014 5:56:07 PM org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (org.apache.http.NoHttpResponseException) caught when processing request to {tls}->http://127.0.0.1:8080->https://issues.apache.org:443: The target server failed to respond
Mar 14, 2014 5:56:07 PM org.apache.http.impl.execchain.RetryExec execute
INFO: Retrying request to {tls}->http://127.0.0.1:8080->https://issues.apache.org:443
Exception in thread "main" org.apache.http.NoHttpResponseException: issues.apache.org:443 failed to respond
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:143)
	at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:57)
	at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:260)
	at org.apache.http.impl.DefaultBHttpClientConnection.receiveResponseHeader(DefaultBHttpClientConnection.java:161)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at org.apache.http.impl.conn.CPoolProxy.invoke(CPoolProxy.java:138)
	at com.sun.proxy.$Proxy0.receiveResponseHeader(Unknown Source)
	at org.apache.http.protocol.HttpRequestExecutor.doReceiveResponse(HttpRequestExecutor.java:271)
	at org.apache.http.protocol.HttpRequestExecutor.execute(HttpRequestExecutor.java:123)
	at org.apache.http.impl.execchain.MainClientExec.createTunnelToTarget(MainClientExec.java:455)
	at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
	at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
	at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
	at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
	at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
	at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:186)
	at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115)
	at com.httpclient3.TestClient.main(TestClient.java:41)

Note - For proxy, i am using tcpmon in proxy mode (no security) just specifying the listen port.

I have posted my detailed code and usecase in stackover flow if you need any references - http://stackoverflow.com/questions/22343149/apache-http-client-4-0-1-ssl-proxy

> Http Proxy with SSL target not working
> --------------------------------------
>
>                 Key: HTTPCLIENT-1481
>                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1481
>             Project: HttpComponents HttpClient
>          Issue Type: Bug
>          Components: HttpClient
>    Affects Versions: 4.2.6
>            Reporter: Vikram
>
> I am using HttpClient 4.0.1 and trying to configure proxy for my target https server but its not working.
> Case being Http Client -> Http Proxy -> Https Target.
> Direct communication between the client and the target is working fine, but when i introduce the proxy. Followed the example provided here - http://hc.apache.org/httpcomponents-client-4.2.x/httpclient/examples/org/apache/http/examples/client/ClientExecuteProxy.java
> Tried posting this on the user lists but no one seems to respond there, is this really supported?



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org