文件 publicCAprivkey.pem 包含 public.pem + ca_int.pem + ca_root.pem 和 private.pem 文件(所有文件都首尾相连)。为 setTrustedCertificatesFile 指定的 pem 文件是服务器的 CA(请参阅上文中有关该文件的解释)。
返回页首。
如何调试? 需要将服务器配置为允许双向通讯。如果要确保情况正是如此,请使用 Web 浏览器,并通过 https 请求 WSDL。请求页面,并查看是否可以建立 SSL 连接(如果它显示 WSDL)。如果可以建立 SSL 连接并且您的浏览器中有客户端证书,请询问服务器管理员是否还要将 SSL 配置设为要求客户端证书。
要确保在 WebLogic 上进行此项设置,请转到控制台: 转到服务器的密钥库 (keystore) 和 SSL 选项卡 向下滚动该页并显示高级选项 Two Way Client Cert Behavior:Client Certs Requested and Enforced 或 Client Certs Requested and not Enforced
“Client Certs Requested and Enforced”将确保在提供“客户端证书”的情况下可以建立 SSL 连接(双向 SSL 连接)。 “Client Certs Requested and not Enforced”让您在不使用客户端证书的情况下仍然可以建立单向 SSL 连接。
如果想调试 SSL 层 (layer),则可在客户端和服务器(如果也是在 WebLogic 上运行)上添加下列内容: java -Dweblogic.security.SSL.verbose=truesetrue
返回页首。
客户端出现了哪些问题? 客户运行与上面示例类似的示例时,可能会遇到以下问题:
问题 1:CERT_CHAIN_INCOMPLETE
<25 mars 2005 10 h 38 TU> <Debug> <TLS> <000000> <Trust failure (68): CERT_CHAIN_INCOMPLETE> <25 mars 2005 10 h 38 TU> <Debug> <TLS> <000000> <NEW ALERT with Severity:FATAL, Type:40 java.lang.Exception:New alert stack
解决办法: 包含证书的文件 clientCredentialFile 没有所需的所有链路。请确保公钥首先位于该文件中,而且确保具有私钥的 CA 跟在后面。
问题 2:Identity Assertion Failed, Unsupported Token Type:X09
[java] java.rmi.RemoteException:SOAP Fault:javax.xml.rpc.soap.SOAPFaultException:[Security:090380]Identity Assertion Failed, Unsupported Token Type:X09
解决办法: 需要对身份声明进行配置。
执行方法如下:
打开 WebLogic 控制台
- Security
- Realms
- Providers
- Authentication
- Select DefaultIdentityAsserter
- Select X509 for the types
然后转到详细信息(列表)
- Select Use Default User Name Mapper
- Default User Name Mapper Attribute Type:例如 CN - Default User Name Mapper Attribute Delimiter:“”
然后应用配置。现在,重新启动服务器。
问题 3:Use Default User Name Mapper
[java] Caused by: javax.xml.rpc.soap.SOAPFaultException: [Security:090377]Identity Assertion Failed, weblogic.security.spi.IdentityAssertionException: [Security:090243]user Name Mapper class not configured - cannot assert identity
解决办法: 这是未在控制台中选择的 Use Default User Name Mapper 的问题。
要对其进行配置,请检查如下内容:
打开 WebLogic 控制台
Security
Realms
Providers
Authentication
Select DefaultIdentityAsserter
Select X509 for the types
然后转到详细信息(列表)
Select Use Default User Name Mapper
Default User Name Mapper Attribute Type:例如 CN
Default User Name Mapper Attribute Delimiter:“”
然后应用配置。现在,重新启动服务器。
问题 4:Authentication Failed:User SMALBOIS02 javax.security.auth.login.LoginException
[java] javax.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: [Security:090304]Authentication Failed: User SMALBOIS02 javax.security.auth.login.LoginException: [Security:090300]Identity Assertion Failed: User SMALBOIS02 does not exist
解决办法: 您使用的是双向 SSL,服务器已识别您的客户端证书、使用了身份声明,只是无法识别 Realm 中的用户。检查用户是否存在于您使用的 Realm 中(例如,内嵌 LDAP 或任何外部用户储存库 ldap 等…)
问题 5:BAD_CERTIFICATE
客户端显示:
[java] <25 mars 2005 14 h 58 TU> <Debug> <TLS> <000000> <NEW ALERT: comerticomlsecordlert.Alert@1cf7491 Severity: 2 Type: 42
[java] <25 mars 2005 14 h 58 TU> <Warning> <Security> <BEA-090482> <BAD_CERTIFICATE alert was received from localhost - 127. Check the peer to determine why it rejected the certificate chain (trusted CA configuration, hostname verification). SSL debug tracing may be required to determine the exact reason the certificate was rejected.> [java] <25 mars 2005 14 h 58 TU> <Debug> <TLS> <000000> <close(): 24374386>
服务器端显示:
<25 mars 2005 14 h 58 TU> <Warning> <Security> <BEA-090478> <Certificate chain received from localhost - 127 was not signed properly causing SSL handshake failure.> <25 mars 2005 14 h 58 TU> <Debug> <TLS> <000000> <Validation error = 1> <25 mars 2005 14 h 58 TU> <Debug> <TLS> <000000> <Certificate chain is invalid> <25 mars 2005 14 h 58 TU> <Debug> <TLS> <000000> <User defined JSSE trustmanagers not allowed to override> <25 mars 2005 14 h 58 TU> <Debug> <TLS> <000000> <SSLTrustValidator returns: 65> <25 mars 2005 14 h 58 TU> <Debug> <TLS> <000000> <Trust failure (65): CERT_CHAIN_INVALID>
解决办法: clientCredentialFile 中证书 CA 的顺序错误。如果将中间 CA 放置在根 CA 之后,则可能出现这种情况。
问题 6: CERT_CHAIN_INCOMPLETE CERT_CHAIN_UNTRUSTED
<25 mars 2005 15 h 10 TU> <Debug> <TLS> <000000> <SSLTrustValidator returns: 84> <25 mars 2005 15 h 10 TU> <Debug> <TLS> <000000> <Trust failure (84): CERT_CHAIN_INCOMPLETE CERT_CHAIN_UNTRUSTED>
解决办法: 受信任的存储可能不正确。请使用诸如 openSSL 之类的工具来验证链路。
返回页首。
|