Can't connect with SSL certificate
<p>I've pfx sectificate, with which I have to log into a specific URL to send and receive data. It's self-signed certificate.</p>

<p>Made <code>pem</code> files:</p>

<pre><code>openssl pkcs12 -in client_ssl.pfx -out client_smsgate-in.pem -clcerts
openssl pkcs12 -in client_ssl.pfx -out ca_client_smsgate-in.pem -cacerts
</code></pre>

<p>Try connections:</p>

<pre><code>require "net/https"
require "uri"

uri = URI.parse("myurl.ru")
pem = File.read("client_smsgate-in.pem")
http = Net::HTTP.new(uri.host, uri.port)

http.use_ssl = true
http.ca_file = File.read("ca_client_smsgate-in.pem")
http.verify_mode = OpenSSL::SSL::VERIFY_PEER

http.cert = OpenSSL::X509::Certificate.new(pem)
http.key = OpenSSL::PKey::RSA.new(pem, 'pass')

request = Net::HTTP::Get.new(uri.request_uri)
response = http.request(request)
</code></pre>

<p>I've error:
<code>lib/ruby/2.2.0/net/http.rb:923:in 'connect': SSL_connect returned=1 errno=0 state=unknown state: certificate verify failed (OpenSSL::SSL::SSLError)
</code>
If check <code>OpenSSL::SSL::VERIFY_NONE</code>, it works. tell me what's wrong, because I have CA certificates to him?</p>