如何使 Ruby 的 SOAP::WSDLDriverFactory 使用自签名证书?

发布于 2024-08-25 08:51:42 字数 591 浏览 4 评论 0原文

这篇文章与另一篇文章有​​些相似:

如何使 Ruby 的 SOAP::RPC::Driver 使用自签名证书?

除了我使用 WSDLDriverFactory:

@loginWsdlUrl = 'https://localhost:9843/services/LoginService?wsdl'
loginClient = SOAP::WSDLDriverFactory.new(@loginWsdlUrl)
loginClient.options['protocol.http.ssl_config.verify_mode' ] = OpenSSL::SSL::VERIFY_NONE 

WSDLDriverFactory 在 .new() 方法内打开 URL,因此似乎不可能首先设置任何选项。我从来没有到达 .options[] 行。

如何提前设置选项?或者,安装一个什么也不做的验证器?

This post is somewhat similar to this other post:

How can I make Ruby's SOAP::RPC::Driver work with self signed certificates?

except I'm using WSDLDriverFactory:

@loginWsdlUrl = 'https://localhost:9843/services/LoginService?wsdl'
loginClient = SOAP::WSDLDriverFactory.new(@loginWsdlUrl)
loginClient.options['protocol.http.ssl_config.verify_mode' ] = OpenSSL::SSL::VERIFY_NONE 

WSDLDriverFactory opens the URL inside the .new() method so it seems impossible to set any options first. I never get to the .options[] line.

How can I set the options ahead of time? Or, install a do-nothing verifier?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小嗲 2024-09-01 08:51:42

loginClient.options['protocol.http.ssl_config.verify_mode'] = nil

loginClient.options['protocol.http.ssl_config.verify_mode' ] = nil

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文