This ruby code is supposed to connect to a secure channel:
connection = Net::HTTP.new "localhost", 8081
connection.use_ssl = true
connection.ssl_version = :TLSv1_2
# ...
connection.post path, data, h
I am having the following error:
usr/local/rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/net/http.rb:923:in `connect': SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (OpenSSL::SSL::SSLError)
Client does have support for TLSv1.2, it looks:
ruby -ropenssl -e 'puts OpenSSL::SSL::SSLContext::METHODS' | grep 1_2
TLSv1_2
TLSv1_2_server
TLSv1_2_client
Also the server has support to TLSv1.2
openssl s_client -connect localhost:8081 | grep Protocol
Protocol : TLSv1.2
Why is Net::HTTP trying to connect using state state=SSLv3
?