'SSL not supported' when calling https web service in Ruby
Posted
by shaleo
on Stack Overflow
See other posts from Stack Overflow
or by shaleo
Published on 2009-11-14T19:37:21Z
Indexed on
2010/03/13
11:15 UTC
Read the original article
Hit count: 350
I am trying to run the following code to call a webservice from ruby but get an error 'SSL not supported'.
I have httpclient 2.1.5.2 installed.
require 'soap/wsdlDriver'
def validate_certificate(is_ok, ctx)
cert = ctx.current_cert
unless (cert.subject.to_s == cert.issuer.to_s) #check the server certificate only
is_ok &&= File.open(file_name).read == ctx.current_cert.to_pem
end
is_ok
end
def test_webservice
wsdl = "https://.../service.wsdl"
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
driver.options['protocol.http.ssl_config.verify_callback'] = method(:validate_certificate)
driver.method(params)
end
© Stack Overflow or respective owner