Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proxy with a endpoint returning a 301 fails to follow the redirect #83

Open
alexvasseur opened this issue Sep 9, 2016 · 1 comment
Open

Comments

@alexvasseur
Copy link

alexvasseur commented Sep 9, 2016

If the endpoint is reachable but traffic goes thru a proxy, it does reports an error when the endpoint has a 301 (REST endpoint, swagger etc)

Shouldn't you provide an option to follow redirect in the proxy, or follow them by default

OUT 2016-09-09 15:02:09.369 ERROR 24 --- [nio-8080-exec-6] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.InternalError: Should not reach here] with root cause
2016-09-09T17:02:09.37+0200 [APP/0]      OUT java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 301 Moved Permanently"
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2085) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.doTunneling(HttpConnectSocketImpl.java:179) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.doTunnel(HttpConnectSocketImpl.java:168) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.access$200(HttpConnectSocketImpl.java:44) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl$2.run(HttpConnectSocketImpl.java:151) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl$2.run(HttpConnectSocketImpl.java:149) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.privilegedDoTunnel(HttpConnectSocketImpl.java:148) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.connect(HttpConnectSocketImpl.java:111) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_71-]
2016-09-09T17:02:09.37+0200 [APP/0]      OUT    at willitconnect.service.util.Connection.checkProxyConnection(Connection.java:45) ~[app/:na]
@alexvasseur alexvasseur changed the title 1.0.4 and proxy with a endpoint returning a 301 fails proxy with a endpoint returning a 301 fails to follow the redirect Sep 10, 2016
@alexvasseur
Copy link
Author

Log with 1.0.7-lts version

2016-09-10T15:13:22.34+0200 [APP/0]      OUT 2016-09-10 13:13:22.345 ERROR 19 --- [nio-8080-exec-8] o.a.c.c.C.[.[.[/].[dispatcherServlet]    : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Handler processing failed; nested exception is java.lang.InternalError: Should not reach here] with root cause
2016-09-10T15:13:22.34+0200 [APP/0]      OUT java.io.IOException: Unable to tunnel through proxy. Proxy returns "HTTP/1.1 301 Moved Permanently"
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at sun.net.www.protocol.http.HttpURLConnection.doTunneling(HttpURLConnection.java:2085) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.lang.reflect.Method.invoke(Method.java:497) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.doTunneling(HttpConnectSocketImpl.java:179) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.doTunnel(HttpConnectSocketImpl.java:168) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.access$200(HttpConnectSocketImpl.java:44) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl$2.run(HttpConnectSocketImpl.java:151) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl$2.run(HttpConnectSocketImpl.java:149) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.security.AccessController.doPrivileged(Native Method) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.privilegedDoTunnel(HttpConnectSocketImpl.java:148) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.net.HttpConnectSocketImpl.connect(HttpConnectSocketImpl.java:111) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_71-]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at willitconnect.service.util.Connection.checkProxyConnection(Connection.java:45) ~[app/:na]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at willitconnect.service.EntryChecker.checkHostname(EntryChecker.java:66) ~[app/:na]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at willitconnect.service.EntryChecker.check(EntryChecker.java:51) ~[app/:na]
2016-09-10T15:13:22.34+0200 [APP/0]      OUT    at willitconnect.controller.WillItConnectV2Controller.willItConnect(WillItConnectV2Controller.java:68) ~[app/:na]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant