2

我已经在我的 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

在 SSL 目录中创建 SSL 目录$NEXUS_HOME/etc/并在 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 重新启动后,我无法通过 URL 访问它//xxx.mycompany.com:8443。火狐 说:

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

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

来自守护进程的错误响应:Get xxx.mycompany.com:8443/v1/users/: x509: certificate signed by unknown authority

我还尝试通过 Google 的各种场景链接证书,包括如何将证书链添加到密钥库?,但在 Docker 上出现错误:

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

在 Firefox 上,和第一次一样,在 Chrome 上:

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

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

4

1 回答 1

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>
于 2017-11-30T08:57:33.227 回答