Web service, download the file linked with HTTPS, and prompt javax.net.ssl.sslkeyexception: RSA premaster secret error

Open source software supply chain lighting plan, waiting for you>>>

Question:

On the server, download the link file of HTTPS and report javax.net.ssl.sslkeyexception: RSA premaster secret error

When running locally, no error is reported, but the error is reported on the server

Solution:

Set lib/ext/sunjce in the JRE directory_ The provider.jar is loaded in

JRE Directory: $Java_ HOME/jre

Load sunjce_ Two methods of provider.jar:

1. Will sunjce_ Copy the provider.jar to the web project directory

2. Modify the startup script and load the JRE directory into classpath

vi catalina.sh

Modify elif [“$1” = “start”]; Then, add – DJava. Ext. dirs to specify the directory to load additional jars, and separate multiple directories with

eval $_NOHUP "\"$_RUNJAVA\"" "\"$LOGGING_CONFIG\"" $LOGGING_MANAGER $JAVV
    A_OPTS $CATALINA_OPTS \
 -D$ENDORSED_PROP="\"$JAVA_ENDORSED_DIRS\"" \
 -classpath "\"$CLASSPATH\"" \
 -Djava.security.manager \
 -Djava.security.policy=="\"$CATALINA_BASE/conf/catalina.policy\"" \
 -Dcatalina.base="\"$CATALINA_BASE\"" \
  -Dcatalina.home="\"$CATALINA_HOME\"" \
  -Djava.ext.dirs="/opt/web/customscript/customlib:$JAVA_HOME/jre/lib/ext" \

Similar Posts: