You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Jetty HTTP Client (9.2.z) that is currently being used in the CometD 3.1.2 distribution is out-of-date. There seems to be a bug in the Jetty HTTP Client preventing a connection from being made with an authenticated HTTP server through an authenticated proxy server.
Below is the code snippet that creates a proxy and http authentication store and adds them to the Jetty HTTP client.
Using the current Cometd 3.1.2 distribution, during runtime, I get this error when I try to get a response from an authenticated HTTP server via an authenticated HTTP proxy server:
2017-08-30 15:33:44.504 WARN org.eclipse.jetty.http.HttpParser [1318] - badMessage: 400 Unknown Version for HttpReceiverOverHTTP@2032f4af(rsp=IDLE,failure=null)[HttpParser{s=RESPONSE_VERSION,0 of -1}]
org.eclipse.jetty.client.HttpResponseException: HTTP protocol violation: bad response on HttpConnectionOverHTTP@2d290bd3(l:/192.168.1.168:65241 <-> r:/192.168.1.239:3128,closed=false)[HttpChannelOverHTTP@52344d8d(exchange=HttpExchange@59dc751d req=TERMINATED/null@null res=PENDING/null@null)[send=HttpSenderOverHTTP@6efc7505(req=QUEUED,snd=COMPLETED,failure=null)[HttpGenerator{s=START}],recv=HttpReceiverOverHTTP@2032f4af(rsp=IDLE,failure=null)[HttpParser{s=CLOSED,0 of -1}]]]
2017-08-30 15:33:44.505 INFO org.cometd.bayeux.client.ClientSession [596] - Exception while invoking listener ch.nimbus.client.BayeuxClientEndpoint$1@5d4169b9
However, if I use the Jetty 9.3+ HTTP Client, I can get a 200 OK HTTP response just fine.
Ideally, I would like use the latest Jetty library (9.4.6), but when I build a BayeuxClient with WebSocket Transport as primary transport, and Jetty HTTP Client with LongPollingTransport as secondary, using the latest Jetty Library (9.4.6), I get this exception during the WebSocket handshake:
Caused by: java.lang.IncompatibleClassChangeError: Found interface org.eclipse.jetty.websocket.api.UpgradeResponse, but class was expected
at org.cometd.websocket.client.JettyWebSocketTransport.onHandshakeResponse(JettyWebSocketTransport.java:140)
at org.eclipse.jetty.websocket.client.WebSocketUpgradeRequest.upgrade(WebSocketUpgradeRequest.java:618)
at org.eclipse.jetty.client.http.HttpChannelOverHTTP.exchangeTerminating(HttpChannelOverHTTP.java:116)
at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:451)
... 23 more
I am currently using Jetty 9.3 library and it works for both transports (websocket and http client long polling with proxy auth + http auth). However, I cannot pass the HTTPClient object into the WebSocketClient constructor so that they can use the same HTTP ProxyConfiguration since it was a newly added feature in Jetty 9.4.
Unfortunately, we cannot publish to Maven Central the same artifacts against different dependencies, so what's in Maven Central will depend on Jetty 9.2.x.
On the other hand, I'm releasing a beta version of CometD 4.0.x today, which is based on JDK 8 and Jetty 9.4.x only, so you may want to try that, and it should solve all your issues.
Thank you for getting back to me Simone! I used the maven build command and it worked like a charm! I'm very much looking forward to CometD 4.0.x! Keep up the good work!
The Jetty HTTP Client (9.2.z) that is currently being used in the CometD 3.1.2 distribution is out-of-date. There seems to be a bug in the Jetty HTTP Client preventing a connection from being made with an authenticated HTTP server through an authenticated proxy server.
Below is the code snippet that creates a proxy and http authentication store and adds them to the Jetty HTTP client.
Using the current Cometd 3.1.2 distribution, during runtime, I get this error when I try to get a response from an authenticated HTTP server via an authenticated HTTP proxy server:
However, if I use the Jetty 9.3+ HTTP Client, I can get a 200 OK HTTP response just fine.
Ideally, I would like use the latest Jetty library (9.4.6), but when I build a BayeuxClient with WebSocket Transport as primary transport, and Jetty HTTP Client with LongPollingTransport as secondary, using the latest Jetty Library (9.4.6), I get this exception during the WebSocket handshake:
I am currently using Jetty 9.3 library and it works for both transports (websocket and http client long polling with proxy auth + http auth). However, I cannot pass the HTTPClient object into the WebSocketClient constructor so that they can use the same HTTP ProxyConfiguration since it was a newly added feature in Jetty 9.4.
Source for the above mentioned: https://stackoverflow.com/questions/32785018/configuring-jetty-websocket-client-to-use-proxy
The text was updated successfully, but these errors were encountered: