Pregunta

I'm using Faraday and Net::HTTP, Net::HTTPS to connect to a site using SSL. However I get the following error: 'SSL_connect returned=1 errno=0 state=SSLv3 read finished A: sslv3 alert handshake failure'

How do I make Faraday turn on debugging and logging in the underlying client?

¿Fue útil?

Solución

Where you initialize the Faraday connection, you can pass things through to the underlying adapter. For example, I use this behavior in one of my clients, albeit with Excon instead of Net::HTTP, but you should be able to adapt:

excon_options = {}
excon_options.merge!(instrumentor: instrumentor) if instrumentor
@connection = Faraday::Connection.new(url: url) do |builder|
  builder.adapter :excon, excon_options
end

The excon_options hash in this case is the format of a hash that I would pass to the Excon connection object if I weren't using Faraday. You should be able to do something similar with Net::HTTP

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top