I am getting the error "sun.security.validator.ValidatorException.." what should I do?

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:

  1. Obtain the certificate from the application owners. It could be your IT department or app developers. 
  2. Add the certificate for the target application to the truststore file of the JVM located at %JAVA_HOME%\lib\security\cacerts
  3. 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
  4. 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>
  5. 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:

  1. Open your web browser and navigate to Subject7 URL.
  2. Click on View Site Information icon in the address bar to view the certificate.
  3. 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)

  1. Press Win + R to open the Run dialog.
  2. Type mmc and press Enter.

Step 3: Add the Certificates Snap-in

  1. In the MMC console, go to File > Add/Remove Snap-in....
  2. In the list of available snap-ins, select Certificates and click Add.
  3. Choose Computer account and click Finish.
  4. Click OK to close the Add/Remove Snap-ins window.

Step 4: Import the Certificate

  1. In the MMC console, expand Certificates (Local Computer) > Trusted Root Certification Authorities.
  2. Right-click on Certificates under Trusted Root Certification Authorities.
  3. Select All Tasks > Import... to open the Certificate Import Wizard.
  4. Click Next on the Welcome page.
  5. Click Browse... to locate the certificate file you saved and select it. Click Next.
  6. Choose the option to place the certificate in the Trusted Root Certification Authorities store. Click Next. 
  7. Click Finish to complete the import process. You should see a message stating that the import was successful.

Step 5: Verify the Import

  1. In the MMC console, expand Certificates (Local Computer) > Trusted Root Certification Authorities > Certificates.
  2. 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.

Was this article helpful?
1 out of 1 found this helpful
Have more questions? Submit a request

Comments

Please sign in to leave a comment.