Open mskyttner opened 4 years ago
I had same issue in Windows, for anyone else coming across this - I resolved by:
C:\Program Files\Java\jre1.8.0_351\bin
Connection is secure >
Export...
button at bottom rightDownloads
)Base64-encoded, certificate chain
Save
keytool -import -file {certfile path} -alias {descriptive name} -keystore {cacerts file}
, where:
{certfile path}
= path to certificate file saved in step 2{descriptive name}
= any reasonable descriptive name for certificate{cacerts file}
= ..\lib\security\cacerts
keytool -import -file "C:\Users\<your username>\Downloads\_.yourdomain.crt" -alias "<your domain>" -keystore "..\lib\security\cacerts"
Enter keystore password:
changeit
Trust this certificate? [no]:
yes
keytool error: java.io.FileNotFoundException: ..\lib\security\cacerts (Access is denied)
If anyone knows a way to avoid the above process I would love to hear! Thanks
When using shinycannon against a https URL with a valid trust chain of certificates recognised by major webbrowsers (in this case involving TERENA SSL CA 3 and DigiCert Assured ID Root CA, which do not seem to come pre-installed in the default trusted keystores used by the Java runtime that executes shinycannon - or in the system package "ca-certificates"), the following exception occurs:
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
This issue is a wish for extended shinycannon documentation to cover a recommended way for how to add the relevant certificates to the Java runtime in order to avoid the above exception when using shinycannon against a valid https url.
In my case I was able to resolve the issue above and get rid of the exception by installing the certificate chain (using the chain.pem-file that Firefox provided when inspecting the SSL certificate) into /usr/local/share/ca-certificates and then running "sudo apt update-ca-certificates" which made the trust chain available to the system (in this case running rocker/tidyverse based on Debian 9 OS). It then also became available to Java at which point shinycannon was happy again. The procedure will likely differ depending on platform / OS where the Java runtime is deployed.