Comment faire en sorte que SOAP :: RPC :: Driver de Ruby fonctionne avec des certificats auto-signés?

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

  •  02-07-2019
  •  | 
  •  

Question

Comment puis-je empêcher cette exception lors d'un appel soap à un serveur utilisant un certificat auto-signé?

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'
Était-ce utile?

La solution

Essayez:

client.options["protocol.http.ssl_config.verify_mode"] = nil 
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top