尝试连接到端点时出错。不能为ssl借用客户端

时间:2016-12-28 18:10:34

标签: wso2 wso2-am wso2carbon

此错误正在WSO2 API Manager wso2carbon.log中打印..

sun.security.ssl.SSLSocketFactoryImpl.createSocket(SSLSocketFactoryImpl.java:88)
    at org.wso2.carbon.databridge.agent.endpoint.binary.BinarySecureClientPoolFactory.createClient(BinarySecureClientPoolFactory.java:53)
    ... 9 more
TID: [-1] [] [2016-12-28 22:16:04,043] ERROR {org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker} -  Error while trying to connect to the endpoint. Cannot borrow client for ssl://192.168.1.36:9711 {org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker}
org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException: Cannot borrow client for ssl://192.168.1.36:9711
    at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:100)
    at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.run(DataEndpointConnectionWorker.java:43)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: org.wso2.carbon.databridge.agent.exception.DataEndpointException: Error while opening socket to 192.168.1.36:9711. Connection refused: connect
    at org.wso2.carbon.databridge.agent.endpoint.binary.BinarySecureClientPoolFactory.createClient(BinarySecureClientPoolFactory.java:58)
    at org.wso2.carbon.databridge.agent.client.AbstractClientPoolFactory.makeObject(AbstractClientPoolFactory.java:39)
    at org.apache.commons.pool.impl.GenericKeyedObjectPool.borrowObject(GenericKeyedObjectPool.java:1212)
    at org.wso2.carbon.databridge.agent.endpoint.DataEndpointConnectionWorker.connect(DataEndpointConnectionWorker.java:92)
    ... 6 more
Caused by: java.net.ConnectException: Connection refused: connect
    at java.net.DualStackPlainSocketImpl.connect0(Native Method)
    at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)

任何人都可以帮我解决这个问题吗?我只是单独使用WSO2 API Manager

2 个答案:

答案 0 :(得分:5)

这里失败的是限制数据发布。可能的原因是thrift端口(9711)在与192.168.1.36不同的网络接口上打开。

您可以在<ThrottlingConfigurations>的{​​{1}}部分配置正确的IP。 (替换api-manager.xml

${carbon.local.ip}

答案 1 :(得分:0)

此异常表明对 APIM-Publisher URL 的连接不是来自经过身份验证的客户端。

要解决此问题,您必须将创建的 .jks 的公共证书导入到 $Server_Home/repository/resources/security/client-truststore.jks 文件中。 client-truststore.jks 包含证书条目,以便客户端可以使用它与后端对话。

按照以下步骤操作。

将公共证书导出到 .pem 文件 keytool -export -alias wso2carbon -keystore wso2carbon.jks -file publickey.pem

上述命令,通过 wso2carbon.jks 密钥库并检查带有“wso2carbon”的条目。找到后,将该条目中的公共证书复制到 publickey.pem 文件中。

将 .pem 文件导入到 client-truststore.jks。 keytool -import -alias wso2 -file publickey.pem -keystore client-truststore.jks -storepass wso2carbon