Http.nonProxyHosts with https requests in Play Framework 1.2.5

I hope someone has come across this earlier and can point me in the right direction. We use the proxy settings in application.conf (http.proxyHost, http.proxyPort and http.nonProxyHosts), and they seem to work fine if the requested URL is http. If we add the host to the nonProxyHosts list and make a request to this host using https, it will not work (a code example and a stack trace follow). If we remove the nonProxyHosts list, the request will work just fine, except that it will go through the proxy. Requests using http work fine, regardless of whether the host is on the nonProxyHosts list or not.

Any help would be appreciated.

Code example

public static void google() { try { renderHtml(WS.url("https://www.google.com").get().getString()); } catch (Exception e) { e.printStackTrace(); } } 

The stack trace that occurs when http.nonProxyHosts = www.google.com and the request is https: java.lang.RuntimeException: java.util.concurrent.ExecutionException: java.io.IOException: remotely closed [id: 0x01f42269, / 10.0.0 .1.100: 56663:> www.google.com/74.125.129.104:443] in play.libs.ws.WSAsync $ WSAsyncRequest.get (WSAsync.java:223) on .api.ContentAPI.google controllers (ContentAPI.java: 86) at sun.reflect.NativeMethodAccessorImpl.invoke0 (own method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:39) on sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodjavaor.lccess25ccess.lccessoravaccess.lccessorccessprevl.log .. .Method.invoke (Method.java►97) in play.mvc.ActionInvoker.invokeWithContinuation (ActionInvoker.java►57) in play.mvc.ActionInvoker.invoke (ActionInvoker.java:508) at play.mvc.ActionInvoker.invokeControllerMethod ( ActionInvoker.java-00-0084) at play.mvc.ActionInvoker.invokeControllerMethod (ActionInvoker.java:479) in play.mvc.ActionInvoker.invoke (ActionInvoker.java:161) in play.server.PlayHandler $ NettyInvocation.execute (PlayHandler.java:251) at play. Invoker $ Invocation.run (Invoker.java:278) on play.server.PlayHandler $ NettyInvocation.run (PlayHandler.java:229) in java.util.concurrent.Executors $ RunnableAdapter.call (Executors.java:439) in java .util.concurrent.FutureTask $ Sync.innerRun (FutureTask.java:303) in java.util.concurrent.FutureTask.run (FutureTask.java:138) in java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.accessread $ ScheduledFutureTask.accessread $ 301 java: 98) in java.util.concurrent.ScheduledThreadPoolExecutor $ ScheduledFutureTask.run (ScheduledThreadPoolExecutor.java:206) in java.util.concurrent.ThreadPoolExecutor $ Worker.runTask (ThreadPoolExecutor.java:88Thread.java:886read $ Worker.run (ThreadPoolExecutor.java:908) in java.lang.Thread.run (Thread. java: 680) Called: java.util.concurrent.ExecutionException: java.io.IOException: remote closed [id: 0x01f42269, / 10.0.1.100: 56663:> www.google.com/74.125.129.104-00-0043] at com. ning.http.client.providers.netty.NettyResponseFuture.abort (NettyResponseFuture.java:297) at com.ning.http.client.providers.netty.NettyAsyncHttpProvider.abort (NettyAsyncHttpProvider.java:1321). client.providers.netty.NettyAsyncHttpProvider.channelClosed (NettyAsyncHttpProvider.java:1384) on org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream (SimpleChannelUpstreamHandler.java:93) on org.chelellpellnetfellnellfellnellfellnellfellnellfellnell java: 564) at org.jboss.netty.channel.DefaultChannelPipeline $ DefaultChannelHandlerContext.sendUpstream (DefaultChannelPipeline.java:792) at org.jboss.netty.handler.stream.ChunkedWriteHandler.handleUpstream (ChunkedWriteHandlerjavajavajava.java) .netty.channel.DefaultChannelP ipeline.sendUpstream (DefaultChannelPipeline.javaPoint64) at org.jboss.netty.channel.DefaultChannelPipeline $ DefaultChannelHandlerContext.sendUpstream (DefaultChannelPipeline.java:792) at org.jboss.netty.handler.codec.replay.Replayingancoder java: 636) on org.jboss.netty.handler.codec.replay.ReplayingDecoder.channelClosed (ReplayingDecoder.java► 033) on org.jboss.netty.handler.codec.http.HttpClientCodec $ Decoder.channelClosed (HttpClientCodec.java 218) at org.jboss.netty.channel.SimpleChannelUpstreamHandler.handleUpstream (SimpleChannelUpstreamHandler.java:93) at org.jboss.netty.handler.codec.http.HttpClientCodec.handleUpstream (HttpClientCodec.java:92.net org .channel.DefaultChannelPipeline.sendUpstream (DefaultChannelPipeline.java<6464) at org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream (DefaultChannelPipeline.java►59) at org.jboss.netty.channel.Channels.fireChanneljosed76els ) on org.jboss.netty. channel.socket.nio.AbstractNioWorker.close (AbstractNioWorker.java:631) at org.jboss.netty.channel.socket.nio.NioWorker.read (NioWorker.java:101) at org.jboss.netty.channel.socket. nio.AbstractNioWorker.processSelectedKeys (AbstractNioWorker.javahaps72) at org.jboss.netty.channel.socket.nio.AbstractNioWorker.run (AbstractNioWorker.java:246) at org.jboss.netty.channel.socket.nio.Nio.Nio.Nio.Nio.Nio.Nio.Nio.Nio.Nio.Nio.Nio run (NioWorker.java:38) at org.jboss.netty.util.ThreadRenamingRunnable.run (ThreadRenamingRunnable.java:102) at org.jboss.netty.util.internal.DeadLockProofWorker $ 1. run (DeadLockProofWorker.java:42). .. 3 more Called: java.io.IOException: remotely closed [id: 0x01f42269, / 10.0.1.100: 56663:> www.google.com/74.125.129.104-00-0043] ... 25 more

+4
source share

Source: https://habr.com/ru/post/1446134/


All Articles