Repository navigation
QFJ-285 Proxy support fixes - #92
Conversation
Fix proxy support with alternative socket hosts Update http proxy to use CONNECT
|
Let me know if you prefer a PR on the master branch |
|
Hi @soliad , Thanks for your update and sorry for the late reply(I have no chance to do the test during holidays).
Got an exception on the server side:
Here're the logs: It seems that the HTTP proxy server(squid) closes the TCP connection immediately right after sending a 407 code to require authenticate. I think this is a reasonable behavior(close the connection) of the HTTP proxy, so we need to handle this scenario in the code, could you take a look? Thanks, |
|
Hi @xiaodwy Unfortunately I dont have a http proxy on hand to test, but I'll take a look at re connection with SSL Arnaud |
|
Hi @soliad , |
|
It should work, but I didn't manage to test with http proxy, only with socks and SSL |
|
Hello,
It sends CONNECT http request with the fix.However it looks like SSL
handshake is not happening after that.
Thank you.
Ramya
…On Thu, Jan 26, 2017 at 6:00 PM Arnaud Lech ***@***.***> wrote:
It should work, but I didn't manage to test with http proxy, only with
socks and SSL
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#92 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AYLuZs3Y8NN4Y5O7-6zBe-BlDHCrKKQiks5rWSWIgaJpZM4LYNna>
.
|
|
It works very well with SOCKS proxy type (SSL enabled).
Could you please check Http with SSL when you get a chance.
Thank you.
Regards,
Dhatchayani G
On Fri, Jan 27, 2017 at 12:42 PM, Ramya Gurunathan <[email protected]>
wrote:
… Hello,
It sends CONNECT http request with the fix.However it looks like SSL
handshake is not happening after that.
Thank you.
Ramya
On Thu, Jan 26, 2017 at 6:00 PM Arnaud Lech ***@***.***>
wrote:
> It should work, but I didn't manage to test with http proxy, only with
> socks and SSL
>
> —
> You are receiving this because you commented.
> Reply to this email directly, view it on GitHub
> <#92 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AYLuZs3Y8NN4Y5O7-6zBe-BlDHCrKKQiks5rWSWIgaJpZM4LYNna>
> .
>
|
|
I cannot test with an http proxy anytime soon. |
|
@soliad |
|
@chrjohn sorry for not being able to test this combination. |
|
Hi @soliad , @xiaodwy , |
|
Hi, |
|
To rule out any problems with MINA please try the latest 2.0.1 or 2.1.0 SNAPSHOT. There was a bug regarding proxy connections.
Configuration can be found here https://quickfixj.org/usermanual/2.0.0//usage/configuration.html
|
|
Hi, |
|
No, currently no plan. |
|
Ok. I will test with the SNAPSHOT version. Will update the result. |
|
Hi, |
|
Hmm, you just need to enter your mail address here: https://sourceforge.net/projects/quickfixj/lists/quickfixj-users and click on "subscribe". The only code change after this PR #92 has been fixed was #177 to include the new MINA version. |
|
Hi, While diagnosing the problem, i found that inside ProtocolFactory.createIoProxyConnector NO_AUTH, DIGEST and BASIC all have been added to the order, while creating the ProxyConnector object which requires ProxyIoSession. |
|
Could you please supply a stack trace on where exactly the Exception is thrown?
I am not very familiar with the proxy code so please excuse my ignorance. If you are able to provide a unit test it would probably help on fixing the issue. Or even better create a new pull request with the fix. Thanks, |
|
I am getting an SSL handshake error when using quickfixj 2.1.0. It reports "SEND TLSv1.2 ALERT: fatal, description = internal_error" during proxy authentication. I have set SocketUseSSL=Y in my config file and SocketConnectPort to 443. My software is running behind a corporate firewall so I have to use the corporate proxy. This is also configured in the config file with ProxyType=http. ProxyUser and ProxyPassword are also set. Using curl to get to the remote URL works. It employs the corporate proxy via the http{s}_proxy environment variables and its detailed trace shows the handshake working correctly. However, my program encounters an SSLException, shown by the trace below. I was getting something like this when usijng quickfixj 1.6.3, which uses an old version of mina (2.0.17) which has a bug reported in this area. With those versions if reported a NEEDS_WRAP error but with quickfixj 2.1.0 it now reports internal error. Here is the log: 3879 [NioProcessor-2] DEBUG org.apache.mina.proxy.handlers.http.AbstractHttpLogicHandler - messageReceived() DEBUG [NioProcessor-2] (AbstractHttpLogicHandler.java:138) - response header received: HTTP/1.0 407 Proxy Authentication Required\r\n Proxy-Authenticate: NTLM\r\n Proxy-Connection: keep-alive\r\n Content-Length: 0\r\n Set-Cookie: SERVERID=proxy11; path=/\r\n \r\n 3883 [NioProcessor-2] DEBUG org.apache.mina.proxy.handlers.http.AbstractHttpLogicHandler - response header received: HTTP/1.0 407 Proxy Authentication Required\r\n Proxy-Authenticate: NTLM\r\n Proxy-Connection: keep-alive\r\n Content-Length: 0\r\n Set-Cookie: SERVERID=proxy11; path=/\r\n \r\n DEBUG [NioProcessor-2] (AbstractHttpLogicHandler.java:359) - parseResponse() 3883 [NioProcessor-2] DEBUG org.apache.mina.proxy.handlers.http.AbstractHttpLogicHandler - parseResponse() NioProcessor-2, called closeOutbound() NioProcessor-2, closeOutboundInternal() NioProcessor-2, called closeInbound() NioProcessor-2, fatal error: 80: Inbound closed before receiving peer's close_notify: possible truncation attack? javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack? NioProcessor-2, SEND TLSv1.2 ALERT: fatal, description = internal_error NioProcessor-2, Exception sending alert: java.io.IOException: writer side was already closed. DEBUG [NioProcessor-2] (SslHandler.java:212) - Unexpected exception from SSLEngine.closeInbound(). javax.net.ssl.SSLException: Inbound closed before receiving peer's close_notify: possible truncation attack? at sun.security.ssl.Alerts.getSSLException(Alerts.java:208) at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1666) at sun.security.ssl.SSLEngineImpl.fatal(SSLEngineImpl.java:1634) at sun.security.ssl.SSLEngineImpl.closeInbound(SSLEngineImpl.java:1561) at org.apache.mina.filter.ssl.SslHandler.destroy(SslHandler.java:210) at org.apache.mina.filter.ssl.SslFilter.initiateClosure(SslFilter.java:787) at org.apache.mina.filter.ssl.SslFilter.filterClose(SslFilter.java:707) |
|
Hi, sorry, I think I cannot be much of help regarding the proxy stuff since I never used it. Maybe someone else can. I would advise you write a mail to the mailing list: https://sourceforge.net/projects/quickfixj/lists/quickfixj-users But did you try to play around with the other proxy parameters like ProxyDomain, ProxyWorkstation etc? From what I gathered from googling they seem to be used for NTLM authentication. Chris. |

Fix proxy support with alternative socket hosts
Update http proxy to use CONNECT