Changing the location of the default SSL certificate file SSLI with environment variable

According to this page, I see where HTTPI is looking for my constant-based SSL certificate OpenSSL::X509::DEFAULT_CERT_FILE:

2.1.5 :008 > OpenSSL::X509::DEFAULT_CERT_FILE
 => "/usr/lib/ssl/cert.pem"

My certificates are located elsewhere, but this page indicates that I can change the path that Ruby looks at in the environment variable SSL_CERT_FILE. I did this in .bashrc:

export SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt

Rails finds an environment variable:

2.1.5 :007 > ENV['SSL_CERT_FILE']
 => "/etc/ssl/certs/ca-certificates.crt"

But this does not affect the OpenSSL constant:

2.1.5 :008 > OpenSSL::X509::DEFAULT_CERT_FILE
 => "/usr/lib/ssl/cert.pem"

Does this page affect the setting correctly SSL_CERT_FILE? Or does a constant never change and affect some other settings? Ultimately, the certificate was not found, so I need to know what it is / how to verify / how to install it.

- , .

+4
1

, OpenSSL , SSL_CERT_FILE DEFAULT_CERT_FILE. , OpenSSL . SSL_CERT_FILE, DEFAULT_CERT_FILE. OpenSSL .

+1

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


All Articles