The error below means Java is trying to access a URL but doesn't have the correct or up to date certificate. Subject7 Player will trust certificates that the Windows OS that it is installed trusts. You can add a certificate to the Windows Trusted Root Certificate trust store using the following commands. Once done Subject7 Player will also trust this certificate.
sun.security.validator.ValidatorException: PKIX path building failed:
sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
To fix this issue from Java side, follow these steps:
- Obtain the certificate from the application owners. It could be your IT department or app developers.
- Add the certificate for the target application to the truststore file of the JVM located at
%JAVA_HOME%\lib\security\cacerts
- You can always check if the certificate is already in the trust store by running the following command:
keytool -list -keystore "%JAVA_HOME%/jre/lib/security/cacerts
- If the certificate is not showing, download it from your browser and add it to the trust store:
keytool -import -noprompt -trustcacerts -alias <AliasName> -file <certificate> -keystore <KeystoreFile> -storepass <Password>
- Check the trust store to see your certitifcate:
keytool -list -keystore "%JAVA_HOME%/jre/lib/security/cacerts"
Here is a reference for trust store and certificates in Oracle JDK: https://docs.oracle.com/javase/tutorial/security/toolsign/rstep2.html
To fix this issue from Windows side, follow the steps:
Step 1: Obtain the Certificate using your web browser:
- Open your web browser and navigate to Subject7 URL.
- Click on View Site Information icon in the address bar to view the certificate.
- Go to the Details tab and click Export to export the certificate in .cer or .crt format.
Step 2: Open the Microsoft Management Console (MMC)
- Press Win + R to open the Run dialog.
- Type mmc and press Enter.
Step 3: Add the Certificates Snap-in
- In the MMC console, go to File > Add/Remove Snap-in....
- In the list of available snap-ins, select Certificates and click Add.
- Choose Computer account and click Finish.
- Click OK to close the Add/Remove Snap-ins window.
Step 4: Import the Certificate
- In the MMC console, expand Certificates (Local Computer) > Trusted Root Certification Authorities.
- Right-click on Certificates under Trusted Root Certification Authorities.
- Select All Tasks > Import... to open the Certificate Import Wizard.
- Click Next on the Welcome page.
- Click Browse... to locate the certificate file you saved and select it. Click Next.
- Choose the option to place the certificate in the Trusted Root Certification Authorities store. Click Next.
- Click Finish to complete the import process. You should see a message stating that the import was successful.
Step 5: Verify the Import
- In the MMC console, expand Certificates (Local Computer) > Trusted Root Certification Authorities > Certificates.
- Look for your imported certificate in the list. Verify that it appears and is correctly listed.
By following these steps, you will have successfully imported the certificate into the Windows OS Trusted Root Certificate Store, which will allow applications and browsers running on this machine to trust the certificate.
Comments
Please sign in to leave a comment.