WebDev
WebDev

Reputation: 404

How to set Ruby SSL method

I am running Ruby 1.9.3, and trying to get either HTTPClient v 2.3.2 or OpenSSL::SSL::Socket to use a different https method than SSLv3 by default. Thanks to the POODLE vulnerability many of the APIs we connect to are refusing SSLv3 connections and I need to change to TLSv1 without patching multiple gems.

How would I go about setting a default SSL method?

Upvotes: 3

Views: 923

Answers (1)

Jeremy Lewis
Jeremy Lewis

Reputation: 1719

OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ssl_version] = :TLSv1

If you're running in a Rails context, you should put the above line of code into an initializer (/config/initializers/openssl.rb).

Upvotes: 5

Related Questions