导入用于 HTTPS 连接的 SSL 证书

如果解决方案中的任何服务器需要提供 SSL 证书来进行通信,均请将所需 SSL 证书导入 WebSphere® Application Server Liberty Profile 缺省密钥库中。

开始之前

您必须首先导出您需要连接到的站点的 SSL 证书,然后才能将所需 SSL 证书导入 WebSphere Application Server Liberty Profile 缺省密钥库中。

关于此任务

如果您不导入所需的 SSL 证书,那么连接到外部站点的任何尝试都可能失败。当相关服务器尝试使用 HTTPS 连接来连接到外部站点时,CertPathBuilderException 错误将显示在日志文件中。 按照以下指示信息来导入这些 SSL 证书,或者如果您更愿意使用图形界面,请使用 iKeyman 工具。

在以下过程中给出的命令中,请将 ioc.userliberty_install_dirliberty.instance.name 变量替换为 ioc.install.properties 安装属性文件中配置的值。ioc.user 变量的缺省值为 iocadminliberty_install_dir 值为 WebSphere Application Server Liberty Profile 安装目录,liberty.instance.name 值为 Liberty 实例的名称。

过程

  1. 导出需要连接到的站点的 SSL 证书。
    1. ioc.user 用户身份登录应用程序服务器。例如,以 iocadmin 身份登录。
    2. 运行以下命令以抽取外部站点的证书,其中 external_host_name:port 是外部服务器的标准主机名称和 SSL 端口号:
      su - ioc.user
      cd liberty_install_dir/usr/servers/liberty.instance.name/resources/security
      openssl s_client -showcerts -connect external_host_name:port </dev/null 2>/dev/null | openssl x509 -outform PEM > 3rd_party_ssl_cert.pem
      例如:
      su - iocadmincd /opt/IBM/WebSphere/wlp/usr/servers/iocsvr1/resources/security
      openssl s_client -showcerts -connect extserver.abc.com:636 </dev/null 2>/dev/null | openssl x509 -outform PEM > 3rd_party_ssl_cert.pem
       
  2. 在服务器上的终端窗口中运行以下命令之一,具体取决于您是在执行开发安装还是运行时安装。
    • 对于开发安装,运行以下命令:
      keytool -import -file path_to_file_that_contains_cert -alias certificate_alias
      -keystore /home/ibmadmin/liberty/usr/servers/defaultServer/resources/security/key.jks
      -storepass keystore_password
    • 对于运行时安装,请运行以下命令,其中 path_to_file_that_contains_cert 是包含 SSL 证书的文件的目录路径,certificate_alias 是 SSL 证书的别名,keystore_password 是 Liberty 密钥库的密码:
      keytool -import -file path_to_file_that_contains_cert -alias certificate_alias
      -keystore /opt/IBM/WebSphere/wlp/usr/servers/iocsvr1/resources/security/key.jks 
      -storepass keystore_password

示例

如果想要将安全 Esri 基本地图添加到解决方案,或者如果想要配置从安全 Esri 功能服务获取数据的数据源,那么必须导入 ArcGIS Server 或 ArcGIS Online 的证书。