我試圖從wso2示例運行示例STS客戶端。
我已經使用常駐身份提供者和服務提供者創建了Identity Server。從wso2IS獲取令牌時出錯STS
我也跟着下面的教程
https://docs.wso2.com/display/IS530/Configuring+an+Identity+Provider#ConfiguringanIdentityProvider-Configuringaresidentidentityprovider
https://docs.wso2.com/display/IS530/Configuring+WS-Trust+STS
https://docs.wso2.com/display/IS510/Configuring+a+Service+Provider#ConfiguringaServiceProvider-Addingaserviceprovider
org.apache.rahas.TrustException: Error in obtaining token from : "https://localhost:9443/services/wso2carbon-sts"
at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:174)
at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:182)
at org.wso2.carbon.identity.samples.sts.Client.run(Client.java:131)
at org.wso2.carbon.identity.samples.sts.Client.main(Client.java:94)
Caused by: org.apache.axis2.AxisFault: Error in hostname verification
at org.apache.axis2.AxisFault.makeFault(AxisFault.java:430)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:199)
at org.apache.axis2.transport.http.HTTPSender.send(HTTPSender.java:77)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageWithCommons(CommonsHTTPTransportSender.java:451)
at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(CommonsHTTPTransportSender.java:278)
at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:442)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:430)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:225)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)
at org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:554)
at org.apache.rahas.client.STSClient.requestSecurityToken(STSClient.java:165)
... 3 more
Caused by: javax.net.ssl.SSLException: Error in hostname verification
at org.opensaml.ws.soap.client.http.TLSProtocolSocketFactory.verifyHostname(TLSProtocolSocketFactory.java:241)
at org.opensaml.ws.soap.client.http.TLSProtocolSocketFactory.createSocket(TLSProtocolSocketFactory.java:194)
at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(MultiThreadedHttpConnectionManager.java:1361)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(AbstractHTTPSender.java:630)
at org.apache.axis2.transport.http.HTTPSender.sendViaPost(HTTPSender.java:195)
... 12 more
Caused by: java.lang.NoSuchMethodError: org.bouncycastle.asn1.ASN1InputStream.readObject()Lorg/bouncycastle/asn1/ASN1Primitive;
at org.opensaml.xml.security.x509.X509Util.getCommonNames(X509Util.java:162)
at org.opensaml.xml.security.x509.tls.StrictHostnameVerifier.check(StrictHostnameVerifier.java:47)
at org.apache.commons.ssl.HostnameVerifier$AbstractVerifier.verify(HostnameVerifier.java:244)
at org.opensaml.ws.soap.client.http.TLSProtocolSocketFactory.verifyHostname(TLSProtocolSocketFactory.java:232)
... 20 more
這裏是我完整的代碼
https://github.com/muke5hy/Axis2Client-wso2IS.git
你有本地主機的/ etc /主機條目? 127.0.0.1 localhost –
不,事實上,它可以在localhost上使用瀏覽器。 –