安全性的 SSL 错误
在配置或启用安全套接字层 (SSL) 之后,您可能会遇到各种问题。 配置 SSL 后,您可能无法停止 Deployment Manager。 您可能无法使用 HTTPS 访问资源。 客户机和服务器可能无法协商正确的安全性级别。
这些问题只是其中几种可能性。 解决这些问题对于 WebSphere Application Server 的成功运行至关重要。
Cannot open keystore URL and since this is a RACFKS, we
will return null: ; java.io.IOException: The key <SITE CERTIFICATE label> is not connected as
a PERSONAL or CERTAUTH certificate. Certificates connected as SITE certificates are not
supported.您遇到的是哪类问题?
- 配置安全套接字层后停止 Deployment Manager
使用以下方式访问资源 HTTPS
- javax.net.ssl.SSLHandshakeException - 客户机和服务器无法通过期望的安全级别。 原因:握手故障
- javax.net.ssl.SSLHandshakeException:未知证书
- javax.net.ssl.SSLHandshakeException:错误证书
java.security.cert.CertificateException: 没有匹配的主题替代 DNS 名称 MYHOST.com
- GUI 应用程序客户机中的“Catalog”图形输入板为空白(未显示项)
- 使用 -scriptCompatibility true 迁移后修改 SSL 配置
- 使用 NOTRUST 选项定义数字证书时独立配置失败
- 在使用 SSL 的情况下配置 LDAP 存储库时出现问题
- 为 SHA384withECDSA 创建链式证书时出现问题
- 处理到期的链式证书
配置安全套接字层后停止 Deployment Manager
配置安全套接字层指令表后,如果您停止 Deployment Manager 但未同时停止 Node Agent,那么您在重新启动 Deployment Manager 时可能接收到以下错误消息:
CWWMU0509I: The server "nodeagent" cannot be reached. It appears to be stopped.
CWWMU0211I: Error details may be seen in the file:
/opt/WebSphere/AppServer/logs/nodeagent/stopServer.log
发生此错误的原因是 Deployment Manager 未将新 SSL 证书传播到 Node Agent。 Node Agent 使用的证书比 Deployment Manager 的证书旧,且这两个证书文件不兼容。 此问题的变通方法是,您必须手动停止 Node Agent 和 Deployment Manager 进程。
要结束进程,请使用 MVS 控制台并键入c process_name.
标识要停止的特定进程时需要注意以下几点。 对于已停止的每个进程, WebSphere Application Server 会将进程标识存储在pid你需要找到这些*.pid格式的文件。 例如,server1.pid对于独立安装操作,可以在以下位置找到:install_root/logs/server1.pid
使用 HTTPS 访问资源
如果您无法访问使用安全套接字层 (SSL) URL (以 https:),或遇到显示 SSL 问题的错误信息,请验证 HTTP 服务器的 SSL 配置是否正确。 输入 URL ,使用 SSL 浏览 HTTP 服务器的欢迎页面:https://host_name.
- 请参阅您 HTTP Server 的文档,以了解有关正确启用 SSL 的指示信息。 如果您使用的是 IBM HTTP Server 或 Apache, 请访问: http://www.ibm.com/software/webservers/httpservers/library.html. 单击常见问题 > SSL。
- 如果使用 IBM Key Management (IKeyman) 工具来创建证书和密钥,请记住在使用 IBM Key Management Tool 创建密钥数据库 (KDB) 文件时将密码隐藏到文件中。
- 转至创建 KDB 文件的目录,并查看.sth文件存在。
- 如果没有,请使用 IBM Key Management Tool 打开 KDB 文件,然后单击 密钥数据库文件> 隐藏密码。 显示以下消息:The password has been encrypted and saved in the file.
如果 HTTP 服务器成功处理了 SSL 加密请求,或者与此无关(例如,流量从 Java™ 客户端应用程序直接流向由 WebSphere Application Server 托管的企业 bean,或者仅在启用 WebSphere Application Server 安全性后才出现问题),您看到的是哪种错误?
系统 SSL:有关使用系统安全套接字层 (SSL) 可调用服务编程接口的信息,请参阅 z/OS 系统安全套接字层编程 SC24-5901 。
- javax.net.ssl.SSLHandshakeException - The client and server could not negotiate the desired level of security. Reason: handshake failure
- javax.net.ssl.SSLHandshakeException - The client and server could not negotiate the desired level of security. Reason: unknown certificate
- javax.net.ssl.SSLHandshakeException - The client and server could not negotiate the desired level of security. Reason: bad certificate
有关诊断和解决安全性相关问题的一般提示,请参阅 安全性组件故障诊断提示
如果未看到与您的问题相似的问题,或者所提供的信息未解决您的问题,请参阅 来自 IBM的故障诊断帮助
javax.net.ssl.SSLHandshakeException - 客户机和服务器无法通过期望的安全级别。 原因:握手故障
[Root exception is org.omg.CORBA.TRANSIENT: CAUGHT_EXCEPTION_WHILE_CONFIGURING_
SSL_CLIENT_SOCKET: CWWJE0080E: javax.net.ssl.SSLHandshakeException - The client
and server could not negotiate the desired level of security. Reason: handshake
failure:host=MYSERVER,port=1079 minor code: 4942F303 completed: No] at
com.ibm.CORBA.transport.TransportConnectionBase.connect
(TransportConnectionBase.java:NNN)- 在客户机和服务器之间没有公共密码。
- 未指定正确的协议。
复审 SSL 设置。 在管理控制台中,单击安全性 > SSL 证书和密钥管理。 在“配置设置”下,单击管理端点安全性配置 > endpoint_configuration_name。 在“相关项”下,单击 SSL 配置 > SSL_configuration_name。 您还可以通过查看 install_root 来手动浏览文件/properties/sas.client.props中。
- 请检查由以下对象指定的属性:com.ibm.ssl.protocol文件以确定指定的协议。
- 检查 com.ibm.ssl.enabledCipherSuites 接口指定的密码类型。 您可能要将更多的密码类型添加到列表中。 要查看当前启用了哪些密码套件,单击保护质量设置 (QoP),然后查找密码套件属性。
- 通过使用不同的客户机或服务器协议和密码选择,更正协议或密码问题。 典型协议是 SSL 或 SSLv3。
javax.net.ssl.SSLHandshakeException:未知证书
ERROR: Could not get the initial context or unable to look up the starting context.
Exiting. Exception received: javax.naming.ServiceUnavailableException: A
communication failure occurred while attempting to obtain an initial context using
the provider url: "corbaloc:iiop:localhost:2809". Make sure that the host and port
information is correct and that the server identified by the provider url is a
running name server. If no port number is specified, the default port number 2809
is used. Other possible causes include the network environment or workstation
network configuration. [Root exception is org.omg.CORBA.TRANSIENT:
CAUGHT_EXCEPTION_WHILE_CONFIGURING_SSL_CLIENT_SOCKET: CWWJE0080E:
javax.net.ssl.SSLHandshakeException - The client and server could not
negotiate the desired level of security. Reason: unknown
certificate:host=MYSERVER,port=1940 minor code: 4942F303 completed: No]- 检查客户机信任库文件以确定是否存在来自服务器个人证书的签署者证书。 对于自签署服务器个人证书,签署者证书是个人证书的公用密钥。 对于认证中心 (CA) 签署的服务器个人证书,签署者证书是签署个人证书的 CA 的根 CA 证书。
- 将服务器签署者证书添加到客户机信任库文件。
javax.net.ssl.SSLHandshakeException:错误证书
- 用于 SSL 相互认证的客户机密钥库中存在个人证书。
- 未将签署者证书抽取到服务器信任库文件中,因此,进行 SSL 握手时,服务器不能信任该证书。
ERROR: Could not get the initial context or unable to look
up the starting context. Exiting.
Exception received: javax.naming.ServiceUnavailableException:
A communication failure occurred while attempting to obtain an
initial context using the provider url: "corbaloc:iiop:localhost:2809".
Make sure that the host and port information is correct and that the
server identified by the provider url is a running name
server. If no port number is specified, the default port number 2809
is used. Other possible causes include the network environment or
workstation network configuration.
[Root exception is org.omg.CORBA.TRANSIENT: CAUGHT_EXCEPTION_WHILE_CONFIGURING_SSL_
CLIENT_SOCKET: CWWJE0080E: javax.net.ssl.SSLHandshakeException - The client and
server could not negotiate the desired level of security. Reason:
bad certificate: host=MYSERVER,port=1940 minor code: 4942F303 completed: No]要验证此问题,检查服务器信任库文件以确定是否存在来自客户机个人证书的签署者证书。 对于自签署客户机个人证书,签署者证书是个人证书的公用密钥。 对于认证中心签署的客户机个人证书,签署者证书是签署个人证书的 CA 的根 CA 证书。
要解决此问题,将客户机签署者证书添加到服务器信任库文件。
java.security.cert.CertificateException: 没有与 MYHOST.com 匹配的主题替代 DNS 名称
主机名和 IP 地址验证是一项重要的安全检查,可确保客户端连接到正确的服务器,从而防止中间人攻击。 不过,在 SSL 握手过程中,主机名验证可能会失败。
CWPKI0062E: SSL HANDSHAKE FAILURE: Host name verification error while connecting to host [MYHOST1.com]. The host name used to access the server does not match the server certificate's [Subject Alternative Name [dnsName:MYHOST2.com]]. The extended error message from the SSL handshake exception is: [No subject alternative DNS name matching MYHOST1.com found.].Program exiting with error:
com.ibm.websphere.management.exception.ConnectorException:
ADMC0016E: The system cannot create a SOAP connector to connect to
host MYHOST.com at port 8888., resulting from:
[SOAPException: faultCode=SOAP-ENV:Client; msg=Error opening socket:
java.io.IOException: Exception during sslSocket.startHandshake:
java.security.cert.CertificateException: No subject alternative DNS
name matching MYHOST.com.;
targetException=java.lang.IllegalArgumentException: Error opening
socket: java.io.IOException: Exception during
sslSocket.startHandshake: java.security.cert.CertificateException:
No subject alternative DNS name matching MYHOST.com
found.]- 主机名不匹配
- 客户端 URL 中指定的主机名与服务器 SSL 证书中的通用名 (CN) 或主题备选名 (SAN) 不匹配。
- SSL 配置不正确
- 服务器上的 SSL 配置可能使用了不包含正确主机名的证书。
- 客户端配置错误
- 客户端可能配置了错误的 URL 或使用了过时的主机名。
- 验证主机名或 IP 地址。
检查 URL 中的主机名或 IP 地址是否与服务器 SSL 证书中的 SAN 或 CN 匹配。 如果 URL 不正确,请使用正确的主机名进行更新。
- 查看 SSL 配置。
确保服务器 SSL 证书配置正确。 SSL 证书必须包含客户端连接的主机名的 SAN 或 CN。
- 重新生成WebSphere® Application Server签发的证书。较新的WebSphere Application Server证书具有更好的 SAN 支持。 运行以下 "wsadmin命令即可重新生成证书:
wsadmin>AdminTask.genAndReplaceCertificates('[-keyStoreName CellDefaultKeyStore -certificateAlias default -extendedKeyUsage ServerAuth_Id,ClientAuth_Id -sanDNSName MYHOST1.com,MYHOST1,MYHOST2.com -sanIPAddress 10.10.1.1,10.10.1.2 -keyStoreScope (cell):MYCell]') wsadmin>AdminConfig.save() - 如果不影响环境的安全性,可以跳过特定主机名、IP 地址或两者的主机名验证。
将 com.ibm.ssl.skipHostnameVerificationForHosts 属性设置为要跳过验证的特定主机名、IP 地址或两者。 用逗号分隔多个条目。
- 将 com.ibm.ssl.verifyHostname 属性设置为
false,即可在不需要进行安全检查时(如在非生产环境中)暂时禁用主机名验证。随后会显示以下信息:CWPKI0063W: Hostname verification is disabled for [MYSSLConfig]. TLS/SSL connections do not check server identities to verify that the client is communicating with the correct server.避免麻烦: 避免在生产环境中禁用主机名验证,因为这会影响安全性。
GUI 应用程序客户机中的“Catalog”图形输入板为空白(未显示项)
安装使用 PlantsByWebSphere Active X 到 EJB 网桥的 ActiveX 客户机样本应用程序时,会出现此错误消息。
这是因为服务器证书不在 client.ssl.props 文件中指定的客户机信任密钥库中。 虽然 "com.ibm.ssl.enableSignerExchangePrompt" 签名器属性可能被设置为true,自动交换提示仅支持命令行提示。 如果样本应用程序依赖于图形用户界面并且不提供对命令提示符的访问(例如,使用标准输入和标准输出),那么自动交换提示不起作用。
要解决此问题,请使用 retrieveSigners 实用程序手动检索证书。
使用 -scriptCompatibility true 迁移后修改 SSL 配置
使用 scriptCompatibility true 进行迁移之后,无法通过管理控制台来编辑 SSL 配置的所有属性。 尤其是,无法显示或编辑硬件密码设置。
使用 scriptCompatibility true 标志并不会将 SSL 配置迁移到 V6.1 及更高发行版中支持的新格式。 在未将配置迁移到最新格式的情况下,添加了不支持的新功能。 如果要从 V6.1 以前的发行版迁移,那么可以使用 convertSSLConfig 任务将 SSL 配置信息转换为集中的 SSL 配置格式。
使用 NOTRUST 选项定义数字证书时独立配置失败
如果使用 NOTRUST 选项定义数字证书,那么您可能会接收到以下错误消息:
Trace: 2008/06/18 16:57:57.798 01 t=8C50B8 c=UNK key=S2 (0000000A)
Description: Log Boss/390 Error
from filename: ./bbgcfcom.cpp
at line: 376
error message: BBOO0042E Function AsynchIOaccept failed with RV=-1, RC=124, RSN=050B0146, ?EDC5124I
Too many open files. (errno2=0x0594003D)??
如果出现此错误,请输入 'D OMVS,P。 如果发生 NOTRUST 问题,那么“OPNSOCK”下会出现一个大数字。
请检查数字证书,并确保它们未标有 NOTRUST 选项。 如果创建证书的日期超出用来创建该证书的 CERTAUTH 的截止日期,那么可能会发生此错误。
在使用 SSL 的情况下配置 LDAP 存储库时出现问题
在配置 LDAP 存储库使用 SSL 时,必须先在节点上配置 LDAP 存储库,然后再向管理代理程序注册该节点。
如果尝试在节点向代理程序注册之后配置 LDAP 存储库,那么联合存储库将在管理代理程序的信任库(而不是节点的信任库)中查找 SSL 证书。
为 SHA384withECDSA 创建链式证书时出现问题
如果您有已转换为 SHA384withECDSA 的证书,并在管理控制台中尝试通过单击 SSL 证书和密钥管理 -> 密钥库和证书 -> key store > 个人证书创建链式证书,然后创建新的链式证书,那么支持的密钥大小应该为 384。 如果不是此值,那么无法创建该证书。
要解决此问题,请启用 JavaScript 以便在面板上显示正确的密钥大小。
处理到期的链式证书
当您必须替换证书链的部分 (包括 CA (认证中心) 证书) ,并且证书链的个别部分已到期时,您需要更新整个链。 具体来说,对于链式自签名证书,您必须在密钥库中创建全新的证书链或更新自签名证书。 详情请参阅更新 SSL 中的证书。 对于 CA 证书链,通常需要通过向 CA 提供新的证书请求文件 (CSR) 来从 CA 请求全新的证书链,以便可以生成新的 CA 证书链。