[英]Rails with Savon over HTTPS: Connection reset by peer
I am using Savon to connect to a web service endpoint via HTTP without issue. 我正在使用Savon通过HTTP连接到Web服务端点而没有问题。 I can do this via SoapUI and via Savon.
我可以通过SoapUI和Savon做到这一点。 I now have to hit an HTTPS endpoint.
我现在必须命中一个HTTPS端点。 I was able to do this with SoapUI (without providing any additional authentication credentials), but when I attempt to connect via Savon, I am getting a "SocketError: Connection reset by peer".
我可以使用SoapUI来做到这一点(不提供任何其他身份验证凭据),但是当我尝试通过Savon连接时,出现“ SocketError:对等重置连接”。 My code is simple:
我的代码很简单:
client = Savon.client(wsdl: "/ws/services/mainservice?wsdl") 客户端= Savon.client(wsdl:“ / ws / services / mainservice?wsdl”)
client.operations 客户运作
As you can see I am simply trying to display the available operations. 如您所见,我只是试图显示可用的操作。 Am I missing something here?
我在这里想念什么吗? Is SoapUI doing somthing "under the covers" that I need to do to the Savon client object?
SoapUI是否正在对Savon客户端对象做“需要做的事情”?
Note: One thing to note is that when I point SoapUI to the wsdl, all is correct save for the endpoint on an individual request. 注意:需要注意的一件事是,当我将SoapUI指向wsdl时,对于单个请求上的端点,所有设置都是正确的。 This is "Http" rather than "https".
这是“ Http”而不是“ https”。 Changing this though makes things work as expected, still without implicitly providing credentials.
更改此设置虽然可使事情按预期工作,但仍未隐式提供凭据。
I guess the client tries to verify the SSL certificate. 我猜客户端会尝试验证SSL证书。 Hence you haven't given one it fails.
因此,您没有给出失败的答案。 You might try this:
您可以尝试以下方法:
client = Savon.client(wsdl: "/ws/services/mainservice?wsdl",
ssl_verify_mode: :none)
client.operations
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.