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

Jenkins agent header check doesn't meet RFC, it's case-sensitive

    Details

    • Similar Issues:

      Description

      When you setup slave with slave-agent.jnlp it tries to connect to /tcpSlaveAgentListener/ and get JNLP port. I'm not sure if this code is relevant but the check seem to be working like this:

      https://github.com/kpfleming/jenkins-remoting/blob/master/src/main/java/hudson/remoting/Engine.java#L166

      However according to RFC 7230 and RFC 7540 HTTP headers are case-insensitive.

       

      The problem is that if you use proxy written in go agent won't connect with an "java.io.IOException: https://myjenkins.net/ is not Jenkins" error.
      See https://github.com/golang/go/issues/21868 for more details.

        Attachments

          Issue Links

            Activity

            Hide
            vulong237 Long Nguyen added a comment - - edited

            The headers extracting function already compare string case-insensitively as shown in https://github.com/jenkinsci/remoting/blob/master/src/main/java/org/jenkinsci/remoting/engine/JnlpAgentEndpointResolver.java#L556

            To test the assumption, I have also modified the header but Remoting could still detect the correct port.

            That's why I conclude that Jenkins no longer caused this error. 

            Please give me permission to close this issue.

            Show
            vulong237 Long Nguyen added a comment - - edited The headers extracting function already compare string case-insensitively as shown in https://github.com/jenkinsci/remoting/blob/master/src/main/java/org/jenkinsci/remoting/engine/JnlpAgentEndpointResolver.java#L556 To test the assumption, I have also modified the header but Remoting could still detect the correct port. That's why I conclude that Jenkins no longer caused this error.  Please give me permission to close this issue.
            Hide
            oleg_nenashev Oleg Nenashev added a comment -

            Yes, it has been fixed by Daniel Beck in JENKINS-40710

            Show
            oleg_nenashev Oleg Nenashev added a comment - Yes, it has been fixed by Daniel Beck in  JENKINS-40710

              People

              • Assignee:
                vulong237 Long Nguyen
                Reporter:
                hryamzik Roman Belyakovsky
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: