Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-54896

Can't get Jenkins to work with proxy under Windows

    Details

    • Similar Issues:

      Description

      I tried installing Jenkins on Windows 8.1 machine today so we could do automatic builds when code is committed in a GitHub repo. But no matter what I try to do, it seems that Jenkins just can't get past our proxy server.

      In the initial setup, and at

      http://localhost:8080/pluginManager/advanced

      I set "Server" to

       

      wwwproxy.abc.com
      

      and "Port" to

       

      80
      

      and leave "User name" and "Password" blank.  

      https://jenkins.io

      in "Test URL", all I ever get is this:

       

      javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated
      	at sun.security.ssl.SSLSessionImpl.getPeerCertificates(Unknown Source)
      	at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.verifyHostName(SSLProtocolSocketFactory.java:257)
      	at org.apache.commons.httpclient.protocol.SSLProtocolSocketFactory.createSocket(SSLProtocolSocketFactory.java:200)
      	at org.apache.commons.httpclient.HttpConnection.tunnelCreated(HttpConnection.java:793)
      	at org.apache.commons.httpclient.HttpMethodDirector.executeConnect(HttpMethodDirector.java:521)
      	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
      	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:178)
      	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:404)
      	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:330)
      	at hudson.ProxyConfiguration$DescriptorImpl.doValidateProxy(ProxyConfiguration.java:371)
      	at java.lang.invoke.MethodHandle.invokeWithArguments(Unknown Source)
      	at org.kohsuke.stapler.Function$MethodFunction.invoke(Function.java:343)
      	at org.kohsuke.stapler.interceptor.RequirePOST$Processor.invoke(RequirePOST.java:77)
      	at org.kohsuke.stapler.PreInvokeInterceptedFunction.invoke(PreInvokeInterceptedFunction.java:26)
      	at org.kohsuke.stapler.Function.bindAndInvoke(Function.java:184)
      	at org.kohsuke.stapler.Function.bindAndInvokeAndServeResponse(Function.java:117)
      	at org.kohsuke.stapler.MetaClass$1.doDispatch(MetaClass.java:130)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      	at org.kohsuke.stapler.MetaClass$5.doDispatch(MetaClass.java:253)
      	at org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:58)
      	at org.kohsuke.stapler.Stapler.tryInvoke(Stapler.java:739)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:870)
      	at org.kohsuke.stapler.Stapler.invoke(Stapler.java:668)
      	at org.kohsuke.stapler.Stapler.service(Stapler.java:238)
      	at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
      	at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:865)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1655)
      	at hudson.util.PluginServletFilter$1.doFilter(PluginServletFilter.java:154)
      	at hudson.util.PluginServletFilter.doFilter(PluginServletFilter.java:157)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at hudson.security.csrf.CrumbFilter.doFilter(CrumbFilter.java:99)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:84)
      	at hudson.security.UnwrapSecurityExceptionFilter.doFilter(UnwrapSecurityExceptionFilter.java:51)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:117)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.providers.anonymous.AnonymousProcessingFilter.doFilter(AnonymousProcessingFilter.java:125)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.rememberme.RememberMeProcessingFilter.doFilter(RememberMeProcessingFilter.java:142)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.ui.AbstractProcessingFilter.doFilter(AbstractProcessingFilter.java:271)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at jenkins.security.BasicHeaderProcessor.doFilter(BasicHeaderProcessor.java:93)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at org.acegisecurity.context.HttpSessionContextIntegrationFilter.doFilter(HttpSessionContextIntegrationFilter.java:249)
      	at hudson.security.HttpSessionContextIntegrationFilter2.doFilter(HttpSessionContextIntegrationFilter2.java:67)
      	at hudson.security.ChainedServletFilter$1.doFilter(ChainedServletFilter.java:87)
      	at hudson.security.ChainedServletFilter.doFilter(ChainedServletFilter.java:90)
      	at hudson.security.HudsonFilter.doFilter(HudsonFilter.java:171)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at org.kohsuke.stapler.compression.CompressionFilter.doFilter(CompressionFilter.java:49)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at hudson.util.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:82)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at org.kohsuke.stapler.DiagnosticThreadNameFilter.doFilter(DiagnosticThreadNameFilter.java:30)
      	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
      	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
      	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:524)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
      	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
      	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1317)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
      	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
      	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
      	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
      	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1219)
      	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
      	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
      	at org.eclipse.jetty.server.Server.handle(Server.java:531)
      	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:352)
      	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
      	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:281)
      	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:102)
      	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
      	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
      	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:762)
      	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:680)
      	at java.lang.Thread.run(Unknown Source)
      

      Sorry about that long call stack, but figured it might be relevant to see the whole thing.

      I see "peer not authenticated" but I don't need to provide credentials to our proxy. I've also tried entering

      http://wwwproxy.abc.com
      

      but that didn't work either. I put this into the "No proxy host" section, to no avail:

      localhost
      *.abc.com
      127.0.0.1

      I've also put this in the jenkins.xml file:

      -Dhttp.proxyHost=wwwproxy.abc.com
      -Dhttp.proxyPort=80
      -Dhttps.proxyHost=wwwproxy.abc.com
      -Dhttps.proxyPort=80

      in the <arguments></arguments> section, then restarted the Jenkins service. No dice.

      I've also set the Jenkins service to run under an administrator account. Nope.

       

      So, I'm at a loss now. What can I do?

      Thank you for any help,

      Alfie

       

       

       

       

       

       

       

        Attachments

          Activity

          Hide
          alfiej Alfie Johnson added a comment -

          So I don't know what I may have done, or maybe it was actually working all along, but it is working now. Let me document so others with similar problems may possibly find a solution.

          Most of the time any address put into the "Test URL" field would lead to the error mentioned in the main post. But I did realize that if I put

          https://www.github.com

          it would work. I have no idea why that URL works, while all others fail.

          So then I tried to install plugins, and got a different error. Some simple searching led to this post:

          https://stackoverflow.com/q/24563694

          and the solution was right below that:

          https://stackoverflow.com/a/52468162

          If you just want the solution:

           

          Go to the Manage Jenkins / Configure Global Security area
          and in the Plugin Manager section, check Use browser for metadata download then click Apply 
          

          and after doing that, I can see all the possible plugins and have been able to install some so I guess Jenkins is actually getting through the proxy.

           

          Show
          alfiej Alfie Johnson added a comment - So I don't know what I may have done, or maybe it was actually working all along, but it is working now. Let me document so others with similar problems may possibly find a solution. Most of the time any address put into the "Test URL" field would lead to the error mentioned in the main post. But I did realize that if I put https: //www.github.com it would work. I have no idea why that URL works, while all others fail. So then I tried to install plugins, and got a different error. Some simple searching led to this post: https://stackoverflow.com/q/24563694 and the solution was right below that: https://stackoverflow.com/a/52468162 If you just want the solution:   Go to the Manage Jenkins / Configure Global Security area and in the Plugin Manager section, check Use browser for metadata download then click Apply  and after doing that, I can see all the possible plugins and have been able to install some so I guess Jenkins is actually getting through the proxy.  

            People

            • Assignee:
              Unassigned
              Reporter:
              alfiej Alfie Johnson
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: