1.下载的需要的证书:

sudo ./$JAVA_HOME/jre/bin/keytool -import -alias WOSt03 -keystore $JAVA_HOME/jre/lib/security/cacerts -file /home/sea/WOS-T03.UFREIGHT.COM

点击:锁 ;查看更多细节

sun 证书问题解决-LMLPHP    sun 证书问题解决-LMLPHP

2.view  certificate

..sun 证书问题解决-LMLPHP

3.导出证书:

sun 证书问题解决-LMLPHP

4.到入证书到JDK

方式1:
/usr/lib/jvm/jdk1..0_172/jre/lib/security$ sudo ../../bin/keytool -import -file /home/sea/Desktop/pebs -keystore /usr/lib/jvm/jdk1..0_172/jre/lib/security/cacerts -alias pebs
方式2:
/usr/lib/jvm/jdk1.8.0_172/jre/lib/security$ sudo ../../bin/keytool -import -file /home/sea/Desktop/0605/192.168.18.118 -keystore /usr/lib/jvm/jdk1.8.0_172/jre/lib/security/jssecacerts -alias 192.168.18.118

说明:

cacerts :可理解为: jdk 的证书库
sudo ../../bin/keytool -import -file [证书的url]   -keystore    /usr/lib/jvm/jdk1.8.0_172/jre/lib/security/cacerts   -alias   pebs
keytool 密令:必须在的它的路径在使用(../jre/bin/下)
 

默认的密码:changeit

dockerfile 中使用:

# where is jre
ENV JRE /usr/lib/jvm/java-8-oracle/jre

# import the sun certificate to jdk

ADD WOS-T01UFREIGHTCOM.crt $JRE/lib/security/

RUN echo "yes" | .$JRE/bin/keytool -import -file $JRE/lib/security/WOS-T01UFREIGHTCOM.crt -alias WOS-T01UFREIGHTCOM -keyalg RSA -keystore $JRE/lib/security/jssecacerts -keypass changeit -storepass changeit

05-21 00:42