Ruby: SSL_connect SYSCALL returned=5 errno=0 state=unknown state (OpenSSL::SSL::SSLError)

前端 未结 2 1403
青春惊慌失措
青春惊慌失措 2020-12-20 12:09

Variants of this error have been posted all over the place but none of the solutions seem to work for me.

I\'m running ruby 2.2.2p95 (2015-04-13 revision 50295

相关标签:
2条回答
  • 2020-12-20 12:54

    I use Mechanize, and I was looking for a patch instead of a configuration of the http client instance. This is how I managed to do it:

    OpenSSL::SSL::SSLContext::DEFAULT_PARAMS[:ciphers] += ':DES-CBC3-SHA'
    
    0 讨论(0)
  • 2020-12-20 13:01

    This looks like exactly the same problem I've answered in https://stackoverflow.com/a/29611892/3081018. Same problem: the server can only do TLS 1.0 and only supports DES-CBC3-SHA as cipher. This cipher is no longer enabled by default in recent ruby versions. To connect with this cipher try to specify the cipher explicitly in your code:

    http.ssl_version = :TLSv1
    http.ciphers = ['DES-CBC3-SHA']
    
    0 讨论(0)
提交回复
热议问题