Is there a java setting for disabling certificate validation?

前端 未结 7 1772
死守一世寂寞
死守一世寂寞 2020-12-01 02:08

I received this error while trying to start up an application:

Sun.security.validator.ValidatorException: PKIX path validation failed: 
java.security.cert.C         


        
7条回答
  •  情深已故
    2020-12-01 02:26

    Use cli utility keytool from java software distribution for import (and trust!) needed certificates

    Sample:

    1. From cli change dir to jre\bin

    2. Check keystore (file found in jre\bin directory)
      keytool -list -keystore ..\lib\security\cacerts
      Enter keystore password: changeit

    3. Download and save all certificates chain from needed server.

    4. Add certificates (before need to remove "read-only" attribute on file "..\lib\security\cacerts") keytool -alias REPLACE_TO_ANY_UNIQ_NAME -import -keystore ..\lib\security\cacerts -file "r:\root.crt"

    accidentally I found such a simple tip. Other solutions require the use of InstallCert.Java and JDK

    source: http://www.java-samples.com/showtutorial.php?tutorialid=210

提交回复
热议问题