当我们启动 Bluemix Liberty 应用程序时出现以下错误,大约每 10 次出现 1 次。如果您尝试进行身份验证,在从 OpenID 提供商重定向后,您会看到一个弹出窗口,要求您提供用户名和密码,这似乎没有任何效果。重新启动应用程序可修复它。
CWWKS1707E: The OpenID Connect client [NTBhZGQ4MWMtN2Y5Ni00] was unable to create an SSL context due to [CWWKS1707E: The OpenID Connect client [NTBhZGQ4MWMtN2Y5Ni00] was unable to create an SSL context due to [Null ssl conext]. Ensure that your SSL feature is properly configured.]. Ensure that your SSL feature is properly configured.
这可能与从我们的 server.xml 中用户提供的服务注入(inject) OpenID 客户端配置有关:
<openidConnectClient
httpsRequired="true" id="blueid" includeIdTokenInSubject="true"
authorizationEndpointUrl="https://${cloud.services.${env.openidservice}.connection.domain}/idaas/oidc/endpoint/default/authorize"
tokenEndpointUrl="https://${cloud.services.${env.openidservice}.connection.domain}/idaas/oidc/endpoint/default/token"
issuerIdentifier="https://${cloud.services.${env.openidservice}.connection.domain}"
clientId="${cloud.services.${env.openidservice}.connection.clientid}"
clientSecret="${cloud.services.${env.openidservice}.connection.clientsecret}"
mapIdentityToRegistryUser="false" scope="openid" signatureAlgorithm="RS256"
trustAliasName="${cloud.services.${env.openidservice}.connection.certificate}"
trustStoreRef="validationKeyStore"
userIdentityToCreateSubject="uniqueSecurityName">
</openidConnectClient>
注入(inject)必须有效,因为错误消息中提到的 clientId 是正确的。不确定为什么 SSL 上下文为空。我尝试过在 server.xml 中使用和不使用 SSL 元素,但问题仍然存在。
有谁知道可能是什么原因吗?
最佳答案
在您的 openid connect 客户端配置中,您没有为 openid connect 客户端定义 SSL 配置,因此 openid connect 客户端正在使用服务器的默认 SSL 配置。要获得确定的行为,我建议您通过将“sslRef=”添加到 openidConnectClient 中来为 openid connect 客户端显式配置 SSL,并且您的 ssl 配置必须包含具有 openid 提供者证书的信任库。
关于ssl - OpenID 空 SSL 上下文错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37459029/