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:
Install
openssl
(done)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)
- Add your RubyGems directory as an environment variable.
export RUBY_DIR=$(gem which rubygems)
- 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?