gpt4 book ai didi

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

转载 作者:数据小太阳 更新时间:2023-10-29 08:06:36 29 4
gpt4 key购买 nike

在对使用自签名证书的服务器进行 soap 调用时,如何防止出现此异常?

require "rubygems"
gem "httpclient", "2.1.2"
require 'http-access2'
require 'soap/rpc/driver'
client = SOAP::RPC::Driver.new( url, 'http://removed' )
client.options[ 'protocol.http.ssl_config.verify_mode' ] = OpenSSL::SSL::VERIFY_NONE
client.options[ 'protocol.http.basic_auth' ] << [ url, user, pass ]

at depth 0 - 18: self signed certificate
/opt/local/lib/ruby/1.8/soap/streamHandler.rb:200:in `send_post': 415: (SOAP::HTTPStreamError)
from /opt/local/lib/ruby/1.8/soap/streamHandler.rb:109:in `send'
from /opt/local/lib/ruby/1.8/soap/rpc/proxy.rb:170:in `route'
from /opt/local/lib/ruby/1.8/soap/rpc/proxy.rb:141:in `call'
from /opt/local/lib/ruby/1.8/soap/rpc/driver.rb:178:in `call'

最佳答案

尝试:

client.options["protocol.http.ssl_config.verify_mode"] = nil 

关于ruby - 如何使 Ruby 的 SOAP::RPC::Driver 使用自签名证书?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/128660/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com