Skip to content

Commit

Permalink
Set the TLS version manually
Browse files Browse the repository at this point in the history
Hopefull this prevents SSL errors such as #203
  • Loading branch information
jcoyne committed Feb 28, 2019
1 parent d150135 commit b4614f0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions config/initializers/ssl.rb
@@ -0,0 +1,7 @@
# By default Ruby 2.5 tries to use SSLv23.
# This sometimes causes this error:
# OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A
#
# See: https://stackoverflow.com/questions/9175151/connecting-using-https-to-a-server-with-a-certificate-signed-by-a-ca-i-created/9262269#9262269

OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ssl_version] = 'TLSv1_2'

0 comments on commit b4614f0

Please sign in to comment.