跳到主要内容 跳到补充内容

为 Nexus 3 启用 SSL

信息注释提示: 有关 Nexus 目录的更多信息,参见 https://help.sonatype.com/repomanager3/installation-and-upgrades/directories (仅提供英文版本)

步骤

  1. 将密钥库文件复制到 $install-dir\etc\ssl 文件夹。
  2. 编辑 $data-dir\etc\nexus.properties 文件,添加 SSL 端口并引用 SSL 配置文件。
    # Jetty section
    application-port=8081
    application-port-ssl=8441
    application-host=0.0.0.0
    nexus-args=${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-https.xml,${jetty.etc}/jetty-requestlog.xml
    nexus-context-path=/
  3. 编辑 SSL 配置文件 $install-dir\etc\jetty\jetty-https.xml,设置证书及密码:
    <New id="sslContextFactory" class="org.eclipse.jetty.util.ssl.SslContextFactory">
      <Set name="KeyStorePath"><Property name="ssl.etc"/>/keystore.jks</Set>
      <Set name="KeyStorePassword">password</Set>
      <Set name="KeyManagerPassword">password</Set>

    因为密钥库文件必须位于一个特定的目录,配置中的路径必需为密钥库的文件名 (紧随一个斜杠)。

  4. 启动 Nexus,您即可通过 SSL 端口登录 Nexus URL。

本页面有帮助吗?

如果您发现此页面或其内容有任何问题 – 打字错误、遗漏步骤或技术错误 – 请告诉我们如何改进!