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

Registering client with HTTPS url results in Connection refused when polling the client #66

Closed
maxwellt opened this issue Apr 25, 2015 · 1 comment
Labels

Comments

@maxwellt
Copy link

Following problem occured when using spring-boot-admin on Heroku. The spring.boot.admin.url in the client project can be HTTPS but the spring.boot.admin.client.url which is used to poll the client for new metrics cannot be HTTPS and must be changed to HTTP.

You get the following error in the logs of the admin app when the client project has spring.boot.admin.client.url set to an HTTPS URL:

2015-04-25T12:42:24.722489+00:00 heroku[router]: at=info method=GET path="/api/applications/0b17d4a9/health" host=vast-tundra-2451.herokuapp.com request_id=3417a253-28ca-43dd-b2d8-43d939ebd57f fwd="62.235.160.238" dyno=web.1 connect=10ms service=14ms status=200 bytes=423
2015-04-25T12:42:24.576719+00:00 app[web.1]: 2015-04-25 12:42:24.576  WARN 3 --- [io-18891-exec-3] o.s.c.n.z.filters.post.SendErrorFilter   : Error during filtering
2015-04-25T12:42:24.576725+00:00 app[web.1]: 
2015-04-25T12:42:24.576727+00:00 app[web.1]: java.net.ConnectException: Connection refused
2015-04-25T12:42:24.576729+00:00 app[web.1]:    at java.net.PlainSocketImpl.socketConnect(Native Method)
2015-04-25T12:42:24.576731+00:00 app[web.1]:    at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345)
2015-04-25T12:42:24.576732+00:00 app[web.1]:    at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
2015-04-25T12:42:24.576734+00:00 app[web.1]:    at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
2015-04-25T12:42:24.576736+00:00 app[web.1]:    at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
2015-04-25T12:42:24.576737+00:00 app[web.1]:    at java.net.Socket.connect(Socket.java:589)
2015-04-25T12:42:24.576739+00:00 app[web.1]:    at sun.security.ssl.SSLSocketImpl.connect(SSLSocketImpl.java:656)
2015-04-25T12:42:24.576740+00:00 app[web.1]:    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:524)
2015-04-25T12:42:24.576742+00:00 app[web.1]:    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:403)
2015-04-25T12:42:24.576743+00:00 app[web.1]:    at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:472)
2015-04-25T12:42:24.576745+00:00 app[web.1]:    at org.apache.http.conn.scheme.SchemeSocketFactoryAdaptor.connectSocket(SchemeSocketFactoryAdaptor.java:65)
2015-04-25T12:42:24.576747+00:00 app[web.1]:    at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:177)
2015-04-25T12:42:24.576750+00:00 app[web.1]:    at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:144)
2015-04-25T12:42:24.576751+00:00 app[web.1]:    at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:131)
2015-04-25T12:42:24.576752+00:00 app[web.1]:    at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:611)
2015-04-25T12:42:24.576754+00:00 app[web.1]:    at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:446)
2015-04-25T12:42:24.576755+00:00 app[web.1]:    at org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:863)
2015-04-25T12:42:24.576757+00:00 app[web.1]:    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:115)
2015-04-25T12:42:24.576758+00:00 app[web.1]:    at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
2015-04-25T12:42:24.576760+00:00 app[web.1]:    at org.springframework.cloud.netflix.zuul.filters.route.SimpleHostRoutingFilter.forwardRequest(SimpleHostRoutingFilter.java:254)
2015-04-25T12:42:24.576762+00:00 app[web.1]:    at org.springframework.cloud.netflix.zuul.filters.route.SimpleHostRoutingFilter.forward(SimpleHostRoutingFilter.java:217)
2015-04-25T12:42:24.576763+00:00 app[web.1]:    at org.springframework.cloud.netflix.zuul.filters.route.SimpleHostRoutingFilter.run(SimpleHostRoutingFilter.java:175)
2015-04-25T12:42:24.576765+00:00 app[web.1]:    at com.netflix.zuul.ZuulFilter.runFilter(ZuulFilter.java:112)
2015-04-25T12:42:24.576766+00:00 app[web.1]:    at com.netflix.zuul.FilterProcessor.processZuulFilter(FilterProcessor.java:197)
2015-04-25T12:42:24.576768+00:00 app[web.1]:    at com.netflix.zuul.FilterProcessor.runFilters(FilterProcessor.java:161)
2015-04-25T12:42:24.576769+00:00 app[web.1]:    at com.netflix.zuul.FilterProcessor.route(FilterProcessor.java:120)
2015-04-25T12:42:24.576771+00:00 app[web.1]:    at com.netflix.zuul.ZuulRunner.route(ZuulRunner.java:84)
2015-04-25T12:42:24.576772+00:00 app[web.1]:    at com.netflix.zuul.http.ZuulServlet.route(ZuulServlet.java:111)
2015-04-25T12:42:24.576773+00:00 app[web.1]:    at com.netflix.zuul.http.ZuulServlet.service(ZuulServlet.java:77)
2015-04-25T12:42:24.576775+00:00 app[web.1]:    at org.springframework.web.servlet.mvc.ServletWrappingController.handleRequestInternal(ServletWrappingController.java:158)
2015-04-25T12:42:24.576777+00:00 app[web.1]:    at org.springframework.cloud.netflix.zuul.web.ZuulController.handleRequestInternal(ZuulController.java:43)
2015-04-25T12:42:24.576779+00:00 app[web.1]:    at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:146)
2015-04-25T12:42:24.576780+00:00 app[web.1]:    at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
2015-04-25T12:42:24.576781+00:00 app[web.1]:    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:943)
2015-04-25T12:42:24.576783+00:00 app[web.1]:    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:877)
2015-04-25T12:42:24.576784+00:00 app[web.1]:    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966)
2015-04-25T12:42:24.576785+00:00 app[web.1]:    at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857)
2015-04-25T12:42:24.576787+00:00 app[web.1]:    at javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
2015-04-25T12:42:24.576788+00:00 app[web.1]:    at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
2015-04-25T12:42:24.576789+00:00 app[web.1]:    at javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
2015-04-25T12:42:24.576791+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:291)
2015-04-25T12:42:24.576792+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-04-25T12:42:24.576793+00:00 app[web.1]:    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
2015-04-25T12:42:24.576795+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
2015-04-25T12:42:24.576803+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-04-25T12:42:24.576805+00:00 app[web.1]:    at org.springframework.boot.actuate.autoconfigure.EndpointWebMvcAutoConfiguration$ApplicationContextHeaderFilter.doFilterInternal(EndpointWebMvcAutoConfiguration.java:291)
2015-04-25T12:42:24.576806+00:00 app[web.1]:    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
2015-04-25T12:42:24.576807+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
2015-04-25T12:42:24.576809+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-04-25T12:42:24.576810+00:00 app[web.1]:    at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:77)
2015-04-25T12:42:24.576811+00:00 app[web.1]:    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
2015-04-25T12:42:24.576813+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
2015-04-25T12:42:24.576814+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-04-25T12:42:24.576816+00:00 app[web.1]:    at org.springframework.boot.actuate.trace.WebRequestTraceFilter.doFilterInternal(WebRequestTraceFilter.java:102)
2015-04-25T12:42:24.576817+00:00 app[web.1]:    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
2015-04-25T12:42:24.576818+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
2015-04-25T12:42:24.576820+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-04-25T12:42:24.576821+00:00 app[web.1]:    at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
2015-04-25T12:42:24.576822+00:00 app[web.1]:    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
2015-04-25T12:42:24.576824+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
2015-04-25T12:42:24.576825+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-04-25T12:42:24.576827+00:00 app[web.1]:    at org.springframework.boot.actuate.autoconfigure.MetricFilterAutoConfiguration$MetricsFilter.doFilterInternal(MetricFilterAutoConfiguration.java:90)
2015-04-25T12:42:24.576828+00:00 app[web.1]:    at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)
2015-04-25T12:42:24.576830+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:239)
2015-04-25T12:42:24.576831+00:00 app[web.1]:    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
2015-04-25T12:42:24.576832+00:00 app[web.1]:    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)
2015-04-25T12:42:24.576834+00:00 app[web.1]:    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:106)
2015-04-25T12:42:24.576835+00:00 app[web.1]:    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:501)
2015-04-25T12:42:24.576837+00:00 app[web.1]:    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:142)
2015-04-25T12:42:24.576838+00:00 app[web.1]:    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79)
2015-04-25T12:42:24.576840+00:00 app[web.1]:    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88)
2015-04-25T12:42:24.576841+00:00 app[web.1]:    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:516)
2015-04-25T12:42:24.576842+00:00 app[web.1]:    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1086)
2015-04-25T12:42:24.576844+00:00 app[web.1]:    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:659)
2015-04-25T12:42:24.576845+00:00 app[web.1]:    at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.process(Http11NioProtocol.java:223)
2015-04-25T12:42:24.576846+00:00 app[web.1]:    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1558)
2015-04-25T12:42:24.576848+00:00 app[web.1]:    at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1515)
2015-04-25T12:42:24.576849+00:00 app[web.1]:    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
2015-04-25T12:42:24.576851+00:00 app[web.1]:    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
2015-04-25T12:42:24.576852+00:00 app[web.1]:    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
2015-04-25T12:42:24.576854+00:00 app[web.1]:    at java.lang.Thread.run(Thread.java:745)
@joshiste
Copy link
Collaborator

Ok, I did take a look on using https with spring boot admin.

  • If a client want's to register at a https-secured admin-server, the client must trust the admin-servers certificate.
  • If a client has registered with a https-secured management url the admin-server must trust the clients certificate. This is because the requests from the UI will be forwarded by the admin-server to the client and therefore the admin-server must trust the clients certificate.

For me, after importing the clients certificate into a keystore and using it via javax.net.ssl.trustStore and javax.net.ssl.trustStorePassword-system properties everything works nicely.

p.s. I think I don't have to clarify that the registered managment url must be reachable from the admin server....

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

No branches or pull requests

2 participants