Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4645

Failing to add custom certificate to be trusted by ruby

$
0
0

I have installed ruby on my MacOS using brew

so:

which -a ruby/opt/homebrew/opt/ruby/bin/ruby/usr/bin/ruby

/usr/bin/ruby is the system ruby I guess that is not to be messed with.

Now I want to add Cloudflare's certificate so that it is trusted by ruby

The instructions on the above link read as follows:

  1. Install openssl (done)

  2. In a terminal, format the Cloudflare certificate for Ruby.

openssl x509 -inform DER -in ~/Downloads/Cloudflare_CA.pem -out ruby-root-ca.crt

To begin with this command fails although the file is there:

openssl x509 -inform DER -in Cloudflare_CA.pem -out ruby-root-ca.crtCould not find certificate from Cloudflare_CA.pem

(so let's assume it is the .crt file needed in the first place)

  1. Add your RubyGems directory as an environment variable.
export RUBY_DIR=$(gem which rubygems)
  1. Copy the Cloudflare certificate to your RubyGems certificate store.
cp ~/Downloads/ruby-root-ca.crt $RUBY_DIR/ssl_cert/rubygems.org

This also fails:

cp Cloudflare_CA.crt $RUBY_DIR/ssl_cert/rubygems.orgcp: /opt/homebrew/Cellar/ruby/3.3.1/lib/ruby/3.3.0/rubygems.rb/ssl_cert/rubygems.org: Not a directory

What is the correct path to add a custom certificate so that ruby can trust it?


Viewing all articles
Browse latest Browse all 4645

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>