如何在Nexus 3上安装CA证书?

时间:2017-10-17 12:58:15

标签: ssl-certificate x509certificate nexus3

我在CentOS Linux版本7.4.1708上安装了Nexus Repository Manager OSS 3.0.2-02。

我也有CA证书:

Issued to: \*.mycompany.com  
Issued by: Go Daddy Secure Certificate Authority - G2  
Valid from 2016-11-12 to 2018-01-11

RSA私钥与我的CA证书匹配,已通过Certificate Key Matcher检查并报告:

  

证书和私钥匹配!

在Nexus3目录中,我做了以下更改:

在文件org.sonatype.nexus.cfg中添加了以下行:

nexus-args=${karaf.etc}/jetty.xml,${karaf.etc}/jetty-http.xml,${karaf.etc}/jetty-requestlog.xml,${karaf.etc}/jetty-https.xml     
application-port-ssl=8443

添加到jetty-https.xml文件的下一行:

KeyStorePath /ssl/test.jks  
KeyStorePassword 123456  
KeyManagerPassword 123456  
TrustStorePath ssl/test.jks  
TrustStorePassword 123456

$NEXUS_HOME/etc/中创建SSL目录,并使用以下命令在SSL目录内创建Java密钥库文件test.jks

openssl pkcs12 -export -in mycompany.com.pem -inkey key.pem -name xxx.mycompany.com -out test.pks
keytool -importkeystore -deststorepass 123456 -destkeystore test.jks -srckeystore test.pks -srcstoretype PKCS12
keytool -import -alias bundle -trustcacerts -file gd_bundle.crt -keystore test.jks

Nexus重新启动后,我无法通过网址//xxx.mycompany.com:8443访问它。 Firefox说:

  

您要查看的页面无法显示,因为   无法验证收到数据的真实性

还尝试执行:docker login xxx.mycompany.com:8443并提供默认admin:admin:123凭据导致:

  

来自守护程序的错误响应:获取xxx.mycompany.com:8443/v1/users/:   x509:由未知权限签署的证书

我还尝试通过Google的各种场景链接证书,包括How to add certificate chain to keystore?,但在Docker上出错:

  

来自守护程序的错误响应:获取//xxx.mycompany.com:8443/v1/users/:EOF

Firefox上的

,与第一次和Chrome相同:

  

// xxx.mycompany.com意外关闭了连接

问题:我的错误在哪里,或者如何在Nexus3上正确安装CA证书?

1 个答案:

答案 0 :(得分:2)

我找到了解决方案。只需要设置jetty-https.xml下一行:

<Set name="NeedClientAuth"><Property name="jetty.ssl.needClientAuth" default="false"/></Set>
<Set name="WantClientAuth"><Property name="jetty.ssl.wantClientAuth" default="false"/></Set>
相关问题