番外篇-解决https SSL自签名证书无效问题
# 本机git窗口操作:将导出的证书from_gitlab.cer证书复制到/usr/local/jdk1.8.0_45/jre/lib/security目录下
scp C:/Users/helenlv/Desktop/DEVOPS/from_gitlab.cer root@10.20.217.17:/usr/local/jdk1.8.0_45/jre/lib/security
[root@gitlab ~]# cd /usr/local/jdk1.8.0_45/jre/lib/security/
[root@gitlab security]# keytool -import -alias from_gitlab -keystore cacerts -file from_gitlab.cer
Enter keystore password:
keytool error: java.io.IOException: Keystore was tampered with, or password was incorrect
[root@gitlab security]# keytool -import -alias from_gitlab -keystore cacerts -file from_gitlab.cer
Enter keystore password:
- 此处省略n行输出,上面密码的changeit
Trust this certificate? [no]: Y
Certificate was added to keystore
[root@gitlab security]# keytool -list -keystore cacerts -alias from_gitlab
Enter keystore password: 此处密码的changeit
将自签名证书加入【受信任的根证书颁发机构】