SSL/HTTPS request error

Hello guys,

I’m need to connect with a webservice via ssl with a certificate. I have
a certificate .pfx and i convert to .pem.

I’m using net/http to consume the webservice but failed. I’ve tried use
savon too, but stopped in the same error.

My Code

uri =
pem =“cert/certificate.pem”)
http =, uri.port)
http.use_ssl = true
http.cert =
http.key =
http.verify_mode = OpenSSL::SSL::VERIFY_PEER



/net/http.rb:895:in `initialize’: SSL_CTX_use_PrivateKey: key values
mismatch (OpenSSL::SSL::SSLError)

Anyone can help me?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs