将证书导入到门户

HTTPS 是加密通信往返 Web 服务器的方法。HTTPS 也允许客户端应用程序确认 Web 服务器的标识。使用 HTTPS 时,启用 HTTPS 的每个 Web 服务器必须向客户端发送证书。证书包含标识语句 (I am gis.mycity.gov) 以及客户端用于将加密信息发送至 Web 服务器的公钥。

Portal for ArcGIS 用户通常传输需要进行加密的信息,因此 HTTPS 在门户中始终处于启用状态而且您的 Web Adaptor 需要使用 HTTPS。安装您的 Web Adaptor 以使用启用 HTTPS 的 Web 服务器。

强烈建议使用由证书颁发机构 (CA) 签发的 Web 服务器证书。门户自身带有自签名证书。自签名证书表示客户端不能验证服务器的标识但能发送加密的内容。使用 CA 签名证书替换自签名证书可提高部署的安全性。

在门户中使用证书有两种方法。第一种方法是通过生成证书签名请求 (CSR)、由 CA 签名并将其导入门户来生成新证书。第二种方法是导入现有证书并且该现有证书已分配给安装有门户的计算机。因为大多数 CA 签名证书要收取费用,在相同计算机上拥有现有证书的客户可能更愿意导入现有证书而不是生成新证书。以下是两种过程的步骤。

以下所有步骤使用名为 Keytool 的工具来管理您的证书。您可以在以下位置找到 Keytool 命令:<Portal for ArcGIS installation location>\arcgis\portal\framework\runtime\jre\bin。您的所有证书将存储在名为 portal.ks 的文件夹中,此文件夹位于 <Portal for ArcGIS installation location>\arcgis\portal\etc\ssl

生成新证书

这些步骤帮助您生成证书签名请求 (CSR)、签名证书并导入组织根证书和已签名的证书。

生成 CSR 并签名

步骤:
  1. 使用以管理员身份运行选项打开命令提示符窗口。
  2. 从命令行浏览至 <Portal for ArcGIS installation location>\framework\runtime\jre\bin 目录。
  3. 运行以下命令:

    keytool –genkey –alias portalcert –keystore <Portal for ArcGIS installation location>/etc/ssl/portal.ks -keyalg RSA

    注注:

    可为 -alias 参数输入您自己的文本;提供 portalcert 作为示例。您选择的别名是很重要的,因为在之后生成 CSR 并将签名证书导入门户时需要重新使用它。

    1. 出现提示时输入 keystore 密码 portal.secret。按 Enter
    2. 询问您的姓氏名字时,输入服务器的完全限定域名称(例如 portal.mycity.gov)。按 Enter
    3. 对于您的组织单位,输入对您站点的用户有意义的部门名称。按 Enter
    4. 指定组织的名称。按 Enter
    5. 指定城市或区域的名称。按 Enter
    6. 指定州或省的名称。按 Enter
    7. 指定您的组织所在的国家的代码,此代码由两个字母组成。按 Enter
    8. 确认指定信息。键入并按 Enter 键。
    9. 或者,也可以指定证书的 keystore 密码。如果您想使用 portal.secret 的默认 Keystore 密码,则无需进行任何指定。按 Enter
  4. 运行以下命令:

    keytool –certreq –alias portalcert –file <Portal for ArcGIS installation location>/etc/ssl/portalcert.csr –keystore <Portal for ArcGIS installation location>/etc/ssl/portal.ks

  5. 指定 keystore 密码。如果使用上述默认值,则密码为 portal.secret。按 Enter

名为 portalcert.csr 的文件会在 <Portal for ArcGIS installation location>/etc/ssl 目录下生成。将此文件发送至您的证书颁发机构进行签名。将返回的文件放置在 <Portal for ArcGIS installation location>\etc\ssl 目录下。

导入组织根证书

步骤:
  1. 使用以管理员身份运行选项打开命令提示符窗口。
  2. 从命令行浏览至 <Portal for ArcGIS installation location>\framework\runtime\jre\bin 目录。
  3. 通过运行以下命令将组织根证书导入至门户:

    keytool –importcert –alias orgRootCert –file <file path to root certificate>/orgRootCert.cer –keystore <Portal for ArcGIS installation location>/etc/ssl/portal.ks

    请联系您的系统管理员,了解如何获取根证书。

    注注:

    可为 -alias 参数输入您自己的文本;提供 orgRootCert 作为示例。

  4. 指定 keystore 密码。如果使用上述默认值,则密码为 portal.secret。按 Enter
  5. 提示信任此证书时,键入并按 Enter 键。

导入签名证书

步骤:
  1. 使用以管理员身份运行选项打开命令提示符窗口。
  2. 从命令行浏览至 <Portal for ArcGIS installation location>\framework\runtime\jre\bin 目录。
  3. 通过运行以下命令导入从证书颁发机构获取的签名证书:

    keytool –importcert –alias portalcert –file <Portal for ArcGIS installation location>/etc/ssl/signedCert.cer –keystore <Portal for ArcGIS installation location>/etc/ssl/portal.ks

  4. 指定 keystore 密码。如果使用上述默认值,则密码为 portal.secret。按 Enter
  5. 在文本编辑器中打开 <Portal for ArcGIS installation location>\framework\runtime\tomcat\conf\server.xml 文件。
  6. 查找 keystorePass="portal.secret" 属性,并将 keyAlias="portalcert" 追加到属性末尾。例如
    keystorePass="portal.secret" keyAlias="portalcert"
    
  7. 保存并关闭文件。
  8. 重新启动 Portal for ArcGIS 使更改生效。有关说明,请参阅停止和启动门户

导入现有证书

这些步骤可帮助您将现有证书导入门户。HTTPS 使用加密钥匙的一对私钥和公钥对其进行加密。公钥包含在证书中并与所有用户共享以便加密信息。为进行加密,需要私钥,而且此私钥必须提供至门户。

私钥和公共证书在 *.p12 或 *.pfx 文件中传输,而且这些文件通常由密码保护。开始前,请确保拥有 *.p12 或 *.pfx 文件并且知道密码。

步骤:
  1. 将 *.p12 或 *.pfx 文件放置在 <Portal for ArcGIS installation location>\etc\ssl 目录下。其余步骤将使用 cert.p12 示例。
  2. 使用以管理员身份运行选项打开命令提示符窗口。
  3. 从命令行浏览至 <Portal for ArcGIS installation location>\etc\ssl 目录。
  4. 查找您正在尝试导入的证书的别名:

    keytool -list -keystore cert.p12 -storetype PKCS12

    出现 keystore 密码提示时,输入 *.p12 或 *.pfx 文件的密码。命令提示将显示一条类似如下所示的消息:

    Keystore type: PKCS12
    Keystore provider: SunJSSE
    
    Your keystore contains 1 entry
    la-620dfedf-681b-4fe0-af13-2d09b1c5515e, Dec 21, 2013, PrivateKeyEntry,
    Certificate fingerprint (SHA1): 28:BB:ED:55:7C:5B:0F:F1:79:54:BF:FE:CC:14:82:20:E5:8F:BF:3D
    

    Your keystore contains 1 entry 文本后的字母和数字字符串是您的证书别名。

  5. 通过定义别名导入证书并将证书别名更改为 portalcert

    keytool -importkeystore -srckeystore cert.p12 -destkeystore portal.ks -srcstoretype PKCS12 -deststoretype JKS -alias la-620dfedf-681b-4fe0-af13-2d09b1c5515e -destalias portalcert

    出现提示时输入目标 keystore 密码 portal.secret。出现提示时,输入 *.p12 或 *.pfx 文件的密码。这将导入证书并将证书别名更改为 portalcert

    注注:

    可为 -destalias 参数输入您自己的文本;提供 portalcert 作为示例。

  6. 验证是否已正确导入证书:

    keytool -list -keystore portal.ks

    出现提示时输入目标 keystore 密码 portal.secret。在 Keystore 条目的列表中,验证是否列出 portalcert 别名。

  7. 更改导入的证书密码以匹配门户的 Keystore 密码:

    keytool -keypasswd -keystore portal.ks -alias portalcert -keypass passwordofp12orpfxfile -new portal.secret

    出现提示时输入目标 keystore 密码 portal.secret。现在您导入的证书密码与门户的 Keystore 密码相同。

  8. 在文本编辑器中打开 <Portal for ArcGIS installation location>\framework\runtime\tomcat\conf\server.xml 文件。
  9. 查找 keystorePass="portal.secret" 属性,并将 keyAlias="portalcert" 追加到属性末尾。例如
    keystorePass="portal.secret" keyAlias="portalcert"
    
  10. 保存并关闭文件。
  11. 重新启动 Portal for ArcGIS 使更改生效。有关说明,请参阅停止和启动门户
5/10/2014