Ruby 's Soap :: RPC :: 드라이버를 자체 서명 인증서로 작동하게하려면 어떻게해야합니까?

StackOverflow https://stackoverflow.com/questions/128660

  •  02-07-2019
  •  | 
  •  

문제

자체 서명 인증서를 사용하는 서버로 비누를 호출 할 때이 예외를 어떻게 방지 할 수 있습니까?

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 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top