2 java ubuntu truststore maven
当我跑步时
mvn clean install -Djavax.net.debug=ssl
Run Code Online (Sandbox Code Playgroud)
我得到的信任库路径为
trustStore 是:/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
Run Code Online (Sandbox Code Playgroud)
那么我如何更改默认信任库的路径?
我正在 ubuntu 18.04 和 openjdk 8 中运行
尝试
-Djavax.net.ssl.trustStore=/real-path/cacerts -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.trustStoreType=jks
Run Code Online (Sandbox Code Playgroud)
如此处所述: 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"
Run Code Online (Sandbox Code Playgroud)