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

Windows slave fails to connect to Jenkins via HTTPS

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Major Major
    • remoting
    • None

      Hi, I configured my Jenkins to listen on HTTPS rather than on HTTP and now I can't seem to get my Windows slaves to connect to it:

      Jenkins: 1.653 on Ubuntu 14.04 64-bit OpenJDK 1.7.0_79 installed via apt-get
      Slave: on Windows 7 64-bit Oracle JRE1.7.0_80

      > java -jar slave.jar -jnlpUrl https://JENKINS/computer/SLAVE/slave-agent.jnlp -secret SECRET -noCertificateCheck
      Skipping HTTPS certificate checks altogether. Note that this is not secure at all.
      Mar 14, 2016 9:01:55 AM hudson.remoting.jnlp.Main createEngine
      INFO: Setting up slave: SLAVE
      Mar 14, 2016 9:01:55 AM hudson.remoting.jnlp.Main$CuiListener <init>
      INFO: Jenkins agent is running in headless mode.
      Mar 14, 2016 9:01:55 AM hudson.remoting.jnlp.Main$CuiListener status
      INFO: Locating server among [http://JENKINS/, https://JENKINS/]
      Mar 14, 2016 9:01:55 AM hudson.remoting.jnlp.Main$CuiListener error
      SEVERE: Unexpected end of file from server
      java.net.SocketException: Unexpected end of file from server
              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
              at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
              at java.lang.reflect.Constructor.newInstance(Unknown Source)
              at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
              at sun.net.www.protocol.http.HttpURLConnection$6.run(Unknown Source)
              at java.security.AccessController.doPrivileged(Native Method)
              at sun.net.www.protocol.http.HttpURLConnection.getChainedException(Unknown Source)
              at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
              at java.net.HttpURLConnection.getResponseCode(Unknown Source)
              at hudson.remoting.Engine.run(Engine.java:206)
      Caused by: java.net.SocketException: Unexpected end of file from server
              at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
              at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
              at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
              at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
              at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
              at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown Source)
              at hudson.remoting.Engine.run(Engine.java:205)
      

          [JENKINS-33524] Windows slave fails to connect to Jenkins via HTTPS

          Oleg Nenashev added a comment -

          It would be great to have server logs

          Oleg Nenashev added a comment - It would be great to have server logs

          Oleg Nenashev added a comment -

          Unlikely it is possible to move this ticket forward without additional info

          Oleg Nenashev added a comment - Unlikely it is possible to move this ticket forward without additional info

          Andrew Ducker added a comment -

          Also getting this.  Server logs for the Node show nothing.

          Client throws this exception:

          java.net.SocketException: Unexpected end of file from server
                  at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
                  at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
                  at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
                  at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
                  at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
                  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
                  at java.net.HttpURLConnection.getResponseCode(Unknown Source)
                  at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:164)
                  at hudson.remoting.Engine.innerRun(Engine.java:335)
                  at hudson.remoting.Engine.run(Engine.java:287)
          

          Replicated on multiple machines, trying to talk to multiple servers.  Only happens if the server is HTTPS.

          Looking inside the file https://testbox:8010/computer/SameBox/slave-agent.jnlp it has a reference to http://ukitdevbuild4:8010/jnlpJars/remoting.jar - which doesn't exist, because that should be https.  The "codebase" tag also points to http when it should point to https.  And finally the first "argument" tag points to http.  If I fix all three of these to point to https instead then I can launch it by dragging/dropping onto IE.

          What I'd expect is that the .jnlp file at https://testbox:8010/computer/SameBox/slave-agent.jnlp would contain https URLs.

          Andrew Ducker added a comment - Also getting this.  Server logs for the Node show nothing. Client throws this exception: java.net.SocketException: Unexpected end of file from server         at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)         at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)         at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)         at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)         at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)         at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)         at java.net.HttpURLConnection.getResponseCode(Unknown Source)         at org.jenkinsci.remoting.engine.JnlpAgentEndpointResolver.resolve(JnlpAgentEndpointResolver.java:164)         at hudson.remoting.Engine.innerRun(Engine.java:335)         at hudson.remoting.Engine.run(Engine.java:287) Replicated on multiple machines, trying to talk to multiple servers.  Only happens if the server is HTTPS. Looking inside the file  https://testbox:8010/computer/SameBox/slave-agent.jnlp it has a reference to http://ukitdevbuild4:8010/jnlpJars/remoting.jar - which doesn't exist, because that should be https .  The "codebase" tag also points to http when it should point to https.  And finally the first "argument" tag points to http.  If I fix all three of these to point to https instead then I can launch it by dragging/dropping onto IE. What I'd expect is that the .jnlp file at https://testbox:8010/computer/SameBox/slave-agent.jnlp would contain https URLs.

          Andrew Ducker added a comment -

          This is probably caused by the same issue as https://issues.jenkins-ci.org/browse/JENKINS-43729 - which is failing to set the Jenkins URL in the Configure System page.

          Andrew Ducker added a comment - This is probably caused by the same issue as https://issues.jenkins-ci.org/browse/JENKINS-43729 - which is failing to set the Jenkins URL in the Configure System page.

          Oleg Nenashev added a comment -

          Since there is no response from the requester && the patter is similar, closing as a duplicate of JENKINS-43729, which is "not a defect"

          Oleg Nenashev added a comment - Since there is no response from the requester && the patter is similar, closing as a duplicate of JENKINS-43729 , which is "not a defect"

            Unassigned Unassigned
            talcloudshare Tal Auslander
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: