Who reads the value of ENV ['SSL_CERT_FILE']?

I got the following error:

OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed from C:/Ruby1.9.2/lib/ruby/1.9.1/net/http.rb:678:in `connect' 

after reading this , I found that the fix is ​​to download the cacert.pem file from. The message recommends doing something like this:

 ENV['SSL_CERT_FILE'] = File.join(File.dirname(__FILE__),"cacert.pem") 

And, indeed, this solves the problem. However, who reads the SSL_CERT_FILE value? Changing the environment is not like the ruby ​​path. I am looking for a solution that can work with both Rails and Sinatra.

+6
source share
1 answer

The openssl library uses the SSL_CERT_FILE environment variable.

+9
source

Source: https://habr.com/ru/post/909986/


All Articles