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

Jenkins cannot handle redirects from http to https URLs in update sites

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • core
    • None

      Jenkins does not handle redirects from HTTP to HTTPS URLs in update sites. So we cannot have HTTPS update sites, as all URLs in update-center.json are HTTP.

          [JENKINS-38340] Jenkins cannot handle redirects from http to https URLs in update sites

          wang ted created issue -
          Daniel Beck made changes -
          Summary Original: Update request does not recognize http response code(302) New: Jenkins cannot handle redirects from http to https URLs in update sites
          Daniel Beck made changes -
          Description Original: Update request does not recognize http response code(302).

          So I could not update my jenkins and plugins.

          The error stack is blew:

          ```
          java.io.IOException: Downloaded file /srv/ci/jenkins/jenkins-2.7.2.war.tmp does not match expected SHA-1, expected 'W4m2ln56+BGcUsfoYiO0dmVBeiI=', actual 'TWpBfQjCw6r1WAlKpmKg7XuzoGc='
          at hudson.model.UpdateCenter.verifyChecksums(UpdateCenter.java:1783)
          at hudson.model.UpdateCenter.access$1100(UpdateCenter.java:147)
          at hudson.model.UpdateCenter$HudsonUpgradeJob.replace(UpdateCenter.java:2069)
          at hudson.model.UpdateCenter$UpdateCenterConfiguration.install(UpdateCenter.java:1178)
          at hudson.model.UpdateCenter$DownloadJob._run(UpdateCenter.java:1653)
          at hudson.model.UpdateCenter$DownloadJob.run(UpdateCenter.java:1624)
          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
          at java.util.concurrent.FutureTask.run(FutureTask.java:262)
          at hudson.remoting.AtmostOneThreadExecutor$Worker.run(AtmostOneThreadExecutor.java:110)
          at java.lang.Thread.run(Thread.java:745)
          ```


          and I `cat` the file `/srv/ci/jenkins/jenkins-2.7.2.war.tmp`, it is:

          ```
          <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
          <html><head>
          <title>302 Found</title>
          </head><body>
          <h1>Found</h1>
          <p>The document has moved <a href="https://mirrors.tuna.tsinghua.edu.cn/jenkins/war/2.22/jenkins.war">here</a>.</p>
          </body></html>
          ```

          redirect from `mirrors.jenkins-ci.org/updates/current/update-center.json` to `https://mirrors.tuna.tsinghua.edu.cn/jenkins/updates/current/update-center.json`

          The error stack is deceptive.
          New: Jenkins does not handle redirects from HTTP to HTTPS URLs in update sites. So we cannot have HTTPS update sites, as all URLs in update-center.json are HTTP.
          Daniel Beck made changes -
          Remote Link New: This issue links to "PR 2552 (Web Link)" [ 14859 ]
          Daniel Beck made changes -
          Link New: This issue is related to JENKINS-8028 [ JENKINS-8028 ]
          Daniel Beck made changes -
          Link New: This issue is related to JENKINS-32796 [ JENKINS-32796 ]
          Daniel Beck made changes -
          Link New: This issue is duplicated by JENKINS-47819 [ JENKINS-47819 ]
          Francisco Fernández made changes -
          Assignee New: Francisco Fernández [ fcojfernandez ]
          Francisco Fernández made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Francisco Fernández made changes -
          Status Original: In Progress [ 3 ] New: In Review [ 10005 ]
          Francisco Fernández made changes -
          Remote Link New: This issue links to "PR 3128 (Web Link)" [ 17994 ]

            fcojfernandez Francisco Fernández
            tedwang wang ted
            Votes:
            6 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated: