Skip to content

Instantly share code, notes, and snippets.

@shanedroid
Last active February 16, 2023 10:43
Show Gist options
  • Select an option

  • Save shanedroid/20ab6f1b50ac9a2d8713c570c165e598 to your computer and use it in GitHub Desktop.

Select an option

Save shanedroid/20ab6f1b50ac9a2d8713c570c165e598 to your computer and use it in GitHub Desktop.

Revisions

  1. shanedroid revised this gist Nov 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion halp.MD
    Original file line number Diff line number Diff line change
    @@ -5,7 +5,7 @@ jenkins github webhook javax.net.ssl.SSLHandshakeException: sun.security.validat

    1) Fetch the certificate from local GitHub:
    ```
    sudo openssl s_client -connect www.github.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/github_public.crt
    openssl s_client -connect www.github.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/github_public.crt
    ```

    2) Import the certificate into the keystore. (I am using Ubuntu 14.04 with Open JDK 7):
  2. shanedroid revised this gist Nov 17, 2016. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions halp.MD
    Original file line number Diff line number Diff line change
    @@ -4,10 +4,14 @@ jenkins github webhook javax.net.ssl.SSLHandshakeException: sun.security.validat
    ```

    1) Fetch the certificate from local GitHub:
    `sudo openssl s_client -connect www.github.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/github_public.crt`
    ```
    sudo openssl s_client -connect www.github.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/github_public.crt
    ```

    2) Import the certificate into the keystore. (I am using Ubuntu 14.04 with Open JDK 7):
    `/usr/lib/jvm/default-java/bin/keytool -import -alias www.github.com -keystore /usr/lib/jvm/default-java/jre/lib/security/cacerts -file /tmp/github_public.crt`
    ```
    /usr/lib/jvm/default-java/bin/keytool -import -alias www.github.com -keystore /usr/lib/jvm/default-java/jre/lib/security/cacerts -file /tmp/github_public.crt
    ```

    3) Bounce Jenkins:
    `service jenkins restart`
  3. shanedroid revised this gist Nov 17, 2016. 1 changed file with 11 additions and 3 deletions.
    14 changes: 11 additions & 3 deletions halp.MD
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,13 @@
    I needed to do this as a workaround while running Jenkins via HTTPS, for some reason I was unable to get any GitHub Webhooks to work and woul dsee the following errs in Jenkins log:

    I needed to do this as a workaround while running Jenkins via HTTPS, for some reason I was unable to get any GitHub Webhooks to work and would see the following errs in Jenkins log:
    ``` bash
    jenkins github webhook javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    ```
    ```

    1) Fetch the certificate from local GitHub:
    `sudo openssl s_client -connect www.github.com:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/github_public.crt`

    2) Import the certificate into the keystore. (I am using Ubuntu 14.04 with Open JDK 7):
    `/usr/lib/jvm/default-java/bin/keytool -import -alias www.github.com -keystore /usr/lib/jvm/default-java/jre/lib/security/cacerts -file /tmp/github_public.crt`

    3) Bounce Jenkins:
    `service jenkins restart`
  4. shanedroid revised this gist Nov 17, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion halp.MD
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    I needed to do this as a workaround while running Jenkins via HTTPS, for some reason I was unable to get any GitHub Webhooks to work and woul dsee the following errs in Jenkins log:

    ```
    ``` bash
    jenkins github webhook javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    ```
  5. shanedroid renamed this gist Nov 17, 2016. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  6. shanedroid created this gist Nov 17, 2016.
    5 changes: 5 additions & 0 deletions halp.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,5 @@
    I needed to do this as a workaround while running Jenkins via HTTPS, for some reason I was unable to get any GitHub Webhooks to work and woul dsee the following errs in Jenkins log:

    ```
    jenkins github webhook javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
    ```