{"action":"created","issue":{"url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1571","repository_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client","labels_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1571/labels{/name}","comments_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1571/comments","events_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1571/events","html_url":"https://github.com/AsyncHttpClient/async-http-client/issues/1571","id":349528975,"node_id":"MDU6SXNzdWUzNDk1Mjg5NzU=","number":1571,"title":"AsycHttpClient throws exception when used with upstream Proxy","user":{"login":"mallik-soupati","id":4961677,"node_id":"MDQ6VXNlcjQ5NjE2Nzc=","avatar_url":"https://avatars1.githubusercontent.com/u/4961677?v=4","gravatar_id":"","url":"https://api.github.com/users/mallik-soupati","html_url":"https://github.com/mallik-soupati","followers_url":"https://api.github.com/users/mallik-soupati/followers","following_url":"https://api.github.com/users/mallik-soupati/following{/other_user}","gists_url":"https://api.github.com/users/mallik-soupati/gists{/gist_id}","starred_url":"https://api.github.com/users/mallik-soupati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mallik-soupati/subscriptions","organizations_url":"https://api.github.com/users/mallik-soupati/orgs","repos_url":"https://api.github.com/users/mallik-soupati/repos","events_url":"https://api.github.com/users/mallik-soupati/events{/privacy}","received_events_url":"https://api.github.com/users/mallik-soupati/received_events","type":"User","site_admin":false},"labels":[{"id":106160664,"node_id":"MDU6TGFiZWwxMDYxNjA2NjQ=","url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/labels/Waiting%20for%20user","name":"Waiting for user","color":"d4c5f9","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-10T14:05:50Z","updated_at":"2018-08-22T10:30:34Z","closed_at":null,"author_association":"NONE","body":"AsyncHttpClient : 2.5.2\r\nNetty                  : 4.1.28.Final\r\nUpstream proxy : Burp 1.7.36\r\n\r\n```\r\nif (proxyConf.isEnabled()) {\r\n            \tRealm proxyRealm = null;\r\n            \tif ( !StringUtil.isNullOrEmpty(proxyConf.getProxyPrincipal())) {\r\n            \t\tproxyRealm = new Realm.Builder(proxyConf.getProxyPrincipal(),proxyConf.getProxyPassword())\r\n            \t\t\t.setScheme(Realm.AuthScheme.BASIC)\r\n            \t\t\t.setUsePreemptiveAuth(true)\r\n            \t\t\t.build();\r\n            \t}\r\n            \tProxyServer.Builder proxyBuilder = new ProxyServer.Builder(proxyConf.getProxyHost(), proxyConf.getProxyPort());\r\n            \tProxyServer proxyServer = null;\r\n            \tif ( proxyRealm != null ) {\r\n            \t\tproxyBuilder.setRealm(proxyRealm);\r\n            \t}\r\n            \tproxyServer = proxyBuilder\r\n            \t\t\t.setProxyType(ProxyType.HTTP)\r\n            \t\t\t.setNonProxyHosts(proxyConf.getProxyNonProxyHosts())\r\n            \t\t\t.build();\r\n                ahcConfigBuilder.setProxyServer(proxyServer);\r\n            }\r\n            if (!proxyConf.isEnablePeerValidation()) {\r\n                ahcConfigBuilder.setDisableHttpsEndpointIdentificationAlgorithm(true);\r\n            }\r\n}\r\n\r\n```\r\nAbove is my code snipped, and I get the below error when execute the request with AsycHttpClient:\r\n\r\n```\r\n2018-08-10 19:12:03,806 ERROR [          AsyncHttpClient-4-16] c.c.c.n.p.flow.WebProxyContext      : Error while processing request\r\nio.netty.handler.codec.UnsupportedMessageTypeException: org.asynchttpclient.netty.request.body.BodyChunkedInput (expected: io.netty.buffer.ByteBuf)\r\n\tat io.netty.handler.ssl.SslHandler.write(SslHandler.java:729)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)\r\n\tat io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.write(CombinedChannelDuplexHandler.java:528)\r\n\tat io.netty.handler.codec.MessageToMessageEncoder.write(MessageToMessageEncoder.java:101)\r\n\tat io.netty.channel.CombinedChannelDuplexHandler.write(CombinedChannelDuplexHandler.java:348)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:738)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:730)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:816)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:723)\r\n\tat io.netty.channel.DefaultChannelPipeline.write(DefaultChannelPipeline.java:1061)\r\n\tat io.netty.channel.AbstractChannel.write(AbstractChannel.java:295)\r\n\tat org.asynchttpclient.netty.request.body.NettyBodyBody.write(NettyBodyBody.java:78)\r\n\tat org.asynchttpclient.netty.request.NettyRequestSender.writeRequest(NettyRequestSender.java:426)\r\n\tat org.asynchttpclient.netty.request.NettyRequestSender.sendRequestWithOpenChannel(NettyRequestSender.java:259)\r\n\tat org.asynchttpclient.netty.request.NettyRequestSender.sendRequestWithCertainForceConnect(NettyRequestSender.java:141)\r\n\tat org.asynchttpclient.netty.request.NettyRequestSender.sendRequest(NettyRequestSender.java:113)\r\n\tat org.asynchttpclient.netty.request.NettyRequestSender.sendNextRequest(NettyRequestSender.java:548)\r\n\tat org.asynchttpclient.netty.request.NettyRequestSender$3.lambda$call$0(NettyRequestSender.java:629)\r\n\tat io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:511)\r\n\tat io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:504)\r\n\tat io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:483)\r\n\tat io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:424)\r\n\tat io.netty.util.concurrent.DefaultPromise.trySuccess(DefaultPromise.java:103)\r\n\tat io.netty.handler.ssl.SslHandler.setHandshakeSuccess(SslHandler.java:1503)\r\n\tat io.netty.handler.ssl.SslHandler.wrapNonAppData(SslHandler.java:915)\r\n\tat io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1338)\r\n\tat io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1177)\r\n\tat io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1221)\r\n\tat io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489)\r\n\tat io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428)\r\n\tat io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)\r\n\tat io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:86)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)\r\n\tat io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340)\r\n\tat io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362)\r\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348)\r\n\tat io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965)\r\n\tat io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:646)\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:581)\r\n\tat io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:498)\r\n\tat io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:460)\r\n\tat io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884)\r\n\tat io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)\r\n\tat java.lang.Thread.run(Thread.java:748)\r\n\r\n```\r\n\r\nI am not sure if I am missing something. Please let me know if any more information is required further.\r\nthanks,"},"comment":{"url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/comments/414987489","html_url":"https://github.com/AsyncHttpClient/async-http-client/issues/1571#issuecomment-414987489","issue_url":"https://api.github.com/repos/AsyncHttpClient/async-http-client/issues/1571","id":414987489,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNDk4NzQ4OQ==","user":{"login":"mallik-soupati","id":4961677,"node_id":"MDQ6VXNlcjQ5NjE2Nzc=","avatar_url":"https://avatars1.githubusercontent.com/u/4961677?v=4","gravatar_id":"","url":"https://api.github.com/users/mallik-soupati","html_url":"https://github.com/mallik-soupati","followers_url":"https://api.github.com/users/mallik-soupati/followers","following_url":"https://api.github.com/users/mallik-soupati/following{/other_user}","gists_url":"https://api.github.com/users/mallik-soupati/gists{/gist_id}","starred_url":"https://api.github.com/users/mallik-soupati/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mallik-soupati/subscriptions","organizations_url":"https://api.github.com/users/mallik-soupati/orgs","repos_url":"https://api.github.com/users/mallik-soupati/repos","events_url":"https://api.github.com/users/mallik-soupati/events{/privacy}","received_events_url":"https://api.github.com/users/mallik-soupati/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T10:30:34Z","updated_at":"2018-08-22T10:30:34Z","author_association":"NONE","body":"It looks like this exception is seen when POST request is executed, via an upstream proxy. NettyBodyBody.write() creates BodyChunkedInput which is not expected at SSLHandler.write(), as it looks for only ByteBuf.\r\n\r\nIs there more information required from me ? to be able to address this issue. Or Am I doing something wrong ?  let me know if I need to follow some guidelines to be able to use HTTPS PROXY.\r\n\r\nthanks.\r\n"}}
{"actor":{"display_login":"mallik-soupati"}}