gongdear

gongdear的技术博客

欢迎大家参观我的博客
  menu
103 文章
89355 浏览
5 当前访客
ღゝ◡╹)ノ❤️

在有pfx证书的前提下使线上nexus3支持https

为方便nexus3的docker私库在线上使用,添加https支持
生成jks证书
在项目的 $install-dir/etc/ssl/目录下,执行命令
keytool -importkeystore -srckeystore mycert.pfx -srcstoretype pkcs12 -destkeystore keystore.jks -deststoretype JKS
输入三次密码,和pfx证书的密码保持一致
添加SSL端口
修改 $data-dir/etc/nexus.properties文件,在第一行添加 application-port-ssl=8443
添加HTTPS支持配置文件
修改 $data-dir/etc/nexus.properties文件,修改Key为 nexus-args所在行的值,在后面添加,${jetty.etc}/jetty-https.xml,${jetty.etc}/jetty-http-redirect-to-https.xml
完整的为 : nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml,${jetty.etc}/jetty-https.xml,${jetty.etc}/jetty-http-redirect-to-https.xml
修改HTTPS配置文件
修改 ${jetty.etc}/jetty-https.xml文件中keystore和truststore的配置部分
<Set name="KeyStorePath"><Property name="ssl.etc"/>/keystore.jks</Set>
<Set name="KeyStorePassword">nexus3</Set>
<Set name="KeyManagerPassword">nexus3</Set>
<Set name="TrustStorePath"><Property name="ssl.etc"/>/keystore.jks</Set>
<Set name="TrustStorePassword">nexus3</Set>
重启nexus即可使用https://gongdear.com:8443访问

宝剑锋从磨砺出,梅花香自苦寒来.