Mirror318
Mirror318

Reputation: 12693

Savon—configure to use TLS 1.2

I'm working on an old project using Savon to connect to the SalesForce api. I'm getting this error:

UNSUPPORTED_CLIENT: TLS 1.0 has been disabled in this organization. Please use TLS 1.1 or higher when connecting to Salesforce using https

How do I get it to use TLS 1.2? Or is there a simple alternative to Savon that does use TLS 1.2?

Upvotes: 2

Views: 1484

Answers (2)

Fabio
Fabio

Reputation: 1

Just to help others in the future who may face the same problem. It seems the TLS level is not built in the savon gem but in the httpi adapter. By changing the adapter to httpclient (installed the gem, put require 'httpclient') the savon gem starts using it without further configuration. Just remove the ssl_level params and the latest and more modern cypher is used. Problem solved.

Upvotes: 0

Steffen Roller
Steffen Roller

Reputation: 3494

Savon uses HTTPI as a common interface for Ruby's HTTP libraries

Configure Savon to use a specific library with:

HTTPI.adapter = :httpclient
HTTPI.adapter = :curb
...

it currently tries the libs in the following order:

[:httpclient, :curb, :em_http, :excon, :net_http, :net_http_persistent]

If you haven't installed httpclient, it will try curbnext and so on.

You should try setting an explicit lib and see if it works for you.

Upvotes: 1

Related Questions