Nexus ssl设定

证明书做成

注意一定要使用 \nexus\jre\bin\keytool 工具

keytool -genkeypair -keystore keystore.jks -storepass 【password】 -alias nexus -keyalg RSA -keysize 2048 -validity 5000 -keypass 【password】 -dname ‘CN=[ip adress], OU=Sonatype, O=Sonatype, L=Unspecified, ST=Unspecified, C=JP’

keytool -exportcert -keystore keystore.jks -alias nexus -rfc > nexus.cert

keytool -importkeystore -srckeystore keystore.jks -destkeystore nexus.p12 -deststoretype PKCS12

keytool -list -keystore nexus.p12 -storetype PKCS12

  • 命令执行路径:nexus\etc\ssl

生成如下文件:

keystore.jks

nexus.p12

nexus.cert

各种设定修改

nexus\etc\nexus-default.properties

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

nexus\etc\jetty\jetty-https.xml

1
2
3
4
<Set name="KeyStorePassword">[password]</Set>
<Set name="KeyManagerPassword">[password]</Set>
<Set name="TrustStorePath"><Property name="ssl.etc"/>/keystore.jks</Set>
<Set name="TrustStorePassword">[password]</Set>
Author: jimmy367
Link: http://www.ohtudou.com/2024/03/21/nexusssl/
Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
支付宝打赏