Last active
November 16, 2024 20:24
-
-
Save waleedsamy/324e1d36a634f2d6fdf6f6fb2a9a9da9 to your computer and use it in GitHub Desktop.
Revisions
-
waleed renamed this gist
Jun 15, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
waleed revised this gist
Jun 15, 2020 . No changes.There are no files selected for viewing
-
waleed renamed this gist
Jun 15, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
waleed revised this gist
Jun 15, 2020 . No changes.There are no files selected for viewing
-
waleed revised this gist
Jun 15, 2020 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -23,13 +23,13 @@ but tools like curl, java.... will report that they're unable to find valid cert ### To fix, you have *two* options - find and add the intermediate certificate that https://client-cert-missing.badssl.com use to your keystore ```bash # add to ubuntu keystore sudo cp COMODORSADomainValidationSecureServerCA.crt /usr/local/share/ca-certificates/COMODORSADomainValidationSecureServerCA.crt sudo update-ca-certificates # add to java keystore sudo keytool -importcert -alias COMODORSADomainValidationSecureServerCA -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -file COMODORSADomainValidationSecureServerCA.crt ``` - Or update your webserver to send the full chain of certificates not just the leaf chain > https://nginx.org/en/docs/http/configuring_https_servers.html -
waleed revised this gist
Jun 15, 2020 . 1 changed file with 13 additions and 13 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -36,16 +36,16 @@ but tools like curl, java.... will report that they're unable to find valid cert > Some browsers may complain about a certificate signed by a well-known certificate authority, while other browsers may accept the certificate without issues. This occurs because the issuing authority has signed the server certificate using an intermediate certificate that is not present in the certificate base of well-known trusted certificate authorities which is distributed with a particular browser. In this case the authority provides a bundle of chained certificates which should be concatenated to the signed server certificate. The server certificate must appear before the chained certificates in the combined file: ``` $ cat www.example.com.crt bundle.crt > www.example.com.chained.crt ``` > The resulting file should be used in the ssl_certificate directive: ``` server { listen 443 ssl; server_name www.example.com; ssl_certificate www.example.com.chained.crt; ssl_certificate_key www.example.com.key; ... } ``` -
waleed revised this gist
Jun 15, 2020 . 1 changed file with 16 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,18 +32,20 @@ but tools like curl, java.... will report that they're unable to find valid cert ``` - Or update your webserver to send the full chain of certificates not just the leaf chain > https://nginx.org/en/docs/http/configuring_https_servers.html > Some browsers may complain about a certificate signed by a well-known certificate authority, while other browsers may accept the certificate without issues. This occurs because the issuing authority has signed the server certificate using an intermediate certificate that is not present in the certificate base of well-known trusted certificate authorities which is distributed with a particular browser. In this case the authority provides a bundle of chained certificates which should be concatenated to the signed server certificate. The server certificate must appear before the chained certificates in the combined file: ``` $ cat www.example.com.crt bundle.crt > www.example.com.chained.crt ``` > The resulting file should be used in the ssl_certificate directive: ``` server { listen 443 ssl; server_name www.example.com; ssl_certificate www.example.com.chained.crt; ssl_certificate_key www.example.com.key; ... } ``` -
waleed revised this gist
Jun 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,7 @@ but tools like curl, java.... will report that they're unable to find valid cert ``` - Or update your webserver to send the full chain of certificates not just the leaf chain https://nginx.org/en/docs/http/configuring_https_servers.html > Some browsers may complain about a certificate signed by a well-known certificate authority, while other browsers may accept the certificate without issues. This occurs because the issuing authority has signed the server certificate using an intermediate certificate that is not present in the certificate base of well-known trusted certificate authorities which is distributed with a particular browser. In this case the authority provides a bundle of chained certificates which should be concatenated to the signed server certificate. The server certificate must appear before the chained certificates in the combined file: ``` $ cat www.example.com.crt bundle.crt > www.example.com.chained.crt -
waleed revised this gist
Jun 15, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -31,7 +31,7 @@ but tools like curl, java.... will report that they're unable to find valid cert sudo keytool -importcert -alias COMODORSADomainValidationSecureServerCA -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -file COMODORSADomainValidationSecureServerCA.crt ``` - Or update your webserver to send the full chain of certificates not just the leaf chain > https://nginx.org/en/docs/http/configuring_https_servers.html > Some browsers may complain about a certificate signed by a well-known certificate authority, while other browsers may accept the certificate without issues. This occurs because the issuing authority has signed the server certificate using an intermediate certificate that is not present in the certificate base of well-known trusted certificate authorities which is distributed with a particular browser. In this case the authority provides a bundle of chained certificates which should be concatenated to the signed server certificate. The server certificate must appear before the chained certificates in the combined file: ``` -
waleed revised this gist
Jun 15, 2020 . 1 changed file with 5 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,7 @@ Open an ssl connection to site ``` openssl s_client -connect client-cert-missing.badssl.com:443 ``` returns ``` . @@ -19,7 +21,7 @@ Verify return code: 21 (unable to verify the first certificate) Even though the intermediate certificate is missing, browsers can still show no problems with https://client-cert-missing.badssl.com: but tools like curl, java.... will report that they're unable to find valid certification path to requested target. ### To fix, you have *two* options - find and add the intermediate certificate that https://client-cert-missing.badssl.com use to your keystore ```bash # add to ubuntu keystore -
waleed revised this gist
Jun 15, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,7 +20,7 @@ Even though the intermediate certificate is missing, browsers can still show no but tools like curl, java.... will report that they're unable to find valid certification path to requested target. To fix, you have two options - find and add the intermediate certificate that https://client-cert-missing.badssl.com use to your keystore ```bash # add to ubuntu keystore sudo cp COMODORSADomainValidationSecureServerCA.crt /usr/local/share/ca-certificates/COMODORSADomainValidationSecureServerCA.crt @@ -29,7 +29,7 @@ To fix, you have two options sudo keytool -importcert -alias COMODORSADomainValidationSecureServerCA -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -file COMODORSADomainValidationSecureServerCA.crt ``` - the is the right way to do it, you need to update your webserver to send the full chain of certificates not just the leaf chain > https://nginx.org/en/docs/http/configuring_https_servers.html > Some browsers may complain about a certificate signed by a well-known certificate authority, while other browsers may accept the certificate without issues. This occurs because the issuing authority has signed the server certificate using an intermediate certificate that is not present in the certificate base of well-known trusted certificate authorities which is distributed with a particular browser. In this case the authority provides a bundle of chained certificates which should be concatenated to the signed server certificate. The server certificate must appear before the chained certificates in the combined file: ``` -
waleed created this gist
Jun 15, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,47 @@ open ssl connection to site `openssl s_client -connect client-cert-missing.badssl.com:443` returns ``` . . . --- Certificate chain 0 s:/C=US/ST=California/L=San Francisco/O=BadSSL Fallback. Unknown subdomain or no SNI./CN=badssl-fallback-unknown-subdomain-or-no-sni i:/C=US/ST=California/L=San Francisco/O=BadSSL/CN=BadSSL Intermediate Certificate Authority --- . . . Verify return code: 21 (unable to verify the first certificate) ``` Even though the intermediate certificate is missing, browsers can still show no problems with https://client-cert-missing.badssl.com: but tools like curl, java.... will report that they're unable to find valid certification path to requested target. To fix, you have two options 1- find and add the intermediate certificate that https://client-cert-missing.badssl.com use to your keystore ```bash # add to ubuntu keystore sudo cp COMODORSADomainValidationSecureServerCA.crt /usr/local/share/ca-certificates/COMODORSADomainValidationSecureServerCA.crt sudo update-ca-certificates # add to java keystore sudo keytool -importcert -alias COMODORSADomainValidationSecureServerCA -keystore $JAVA_HOME/jre/lib/security/cacerts -storepass changeit -file COMODORSADomainValidationSecureServerCA.crt ``` 2- the is the right way to do it, you need to update your webserver to send the full chain of certificates not just the leaf chain > https://nginx.org/en/docs/http/configuring_https_servers.html > Some browsers may complain about a certificate signed by a well-known certificate authority, while other browsers may accept the certificate without issues. This occurs because the issuing authority has signed the server certificate using an intermediate certificate that is not present in the certificate base of well-known trusted certificate authorities which is distributed with a particular browser. In this case the authority provides a bundle of chained certificates which should be concatenated to the signed server certificate. The server certificate must appear before the chained certificates in the combined file: ``` $ cat www.example.com.crt bundle.crt > www.example.com.chained.crt ``` > The resulting file should be used in the ssl_certificate directive: ``` server { listen 443 ssl; server_name www.example.com; ssl_certificate www.example.com.chained.crt; ssl_certificate_key www.example.com.key; ... } ```