如何更改默认信任库路径
how to change default truststore path
当我 运行
mvn clean install -Djavax.net.debug=ssl
我得到信任库路径
trustStore is:
/home/user/Downloads/jdk8/openjdk-8u40-b25-linux-x64-10_feb_2015/java-se-8u40-ri/jre/lib/security/cacerts
但这是一条错误的道路,它最终给了我这个错误
Failed to read artifact descriptor for org.springframework.statemachine:spring-statemachine-core:jar:
2.1.3.RELEASE: Could not transfer artifact org.springframework.statemachine:spring-statemachine-core:
pom:2.1.3.RELEASE from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException:
Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
那么我该如何更改默认信任库的路径??
我在 运行宁 ubuntu 18.04
和 openjdk 8
尝试
-Djavax.net.ssl.trustStore=/real-path/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStoreType=jks
如此处所述:
https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html,也可以导出/设置环境变量:
JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=/real-path/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStoreType=jks"
当我 运行
mvn clean install -Djavax.net.debug=ssl
我得到信任库路径
trustStore is: /home/user/Downloads/jdk8/openjdk-8u40-b25-linux-x64-10_feb_2015/java-se-8u40-ri/jre/lib/security/cacerts
但这是一条错误的道路,它最终给了我这个错误
Failed to read artifact descriptor for org.springframework.statemachine:spring-statemachine-core:jar:
2.1.3.RELEASE: Could not transfer artifact org.springframework.statemachine:spring-statemachine-core:
pom:2.1.3.RELEASE from/to central (https://repo.maven.apache.org/maven2): java.lang.RuntimeException:
Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
那么我该如何更改默认信任库的路径??
我在 运行宁 ubuntu 18.04 和 openjdk 8
尝试
-Djavax.net.ssl.trustStore=/real-path/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStoreType=jks
如此处所述: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/envvars002.html,也可以导出/设置环境变量:
JAVA_TOOL_OPTIONS="-Djavax.net.ssl.trustStore=/real-path/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStoreType=jks"