Search code examples
opensslhomebrewrvm

homebrew openssl + rvm broken


Somehow my RVM is unable to install gems because my openssl stopped working. I have openssl and openssl@1.1 installed through brew. After updating to macOS 10.14 I am unable to install gems. When I try I get:

$ gem install rdoc-data -v 3.12
ERROR:  Could not find a valid gem 'rdoc-data' (= 3.12), here is why:
          Unable to download data from https://rubygems.org/ - SSL_connect returned=1 errno=0 state=SSLv2/v3 read server hello A: tlsv1 alert protocol version (https://rubygems.org/specs.4.8.gz)

When I check the RVM ssl-certs I get:

1st machine $ rvm osx-ssl-certs status all
Warning! PATH is not properly set up, /Users/MYACCOUNT/.rvm/gems/ruby-1.8.7-head/bin is not at first place.
         Usually this is caused by shell initialization files. Search for PATH=... entries.
         You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
         To fix it temporarily in this shell session run: rvm use ruby-1.8.7-head
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
Selected SSL certs for: ruby-2.3.4
cURL certificate bundle /usr/share/curl/curl-ca-bundle.crt not found
Certificates bundle /usr/local/etc/openssl/cert.pem is up to date.
Certificates bundle /etc/openssl/cert.pem is up to date.
Certificates bundle /System/Library/OpenSSL/cert.pem is old.
Certificates bundle  is old.
Certificates bundle /usr/local/etc/openssl@1.1/cert.pem is up to date.

and

1st machine $ rvm osx-ssl-certs update all
.
.
cURL certificate bundle /usr/share/curl/curl-ca-bundle.crt not found
Updating certificates bundle /usr/local/etc/openssl/cert.pem: Already up to date.
Updating certificates bundle /etc/openssl/cert.pem: Already up to date.
Updating certificates bundle /System/Library/OpenSSL/cert.pem: Updating certificates bundle '/System/Library/OpenSSL/cert.pem'
MYACCOUNT password required for 'command tee /System/Library/OpenSSL/cert.pem': 
tee: /System/Library/OpenSSL/cert.pem: Operation not permitted
Failed.
Updating certificates bundle /System/Library/OpenSSL/cert.pem: Updating certificates bundle '/System/Library/OpenSSL/cert.pem'
tee: /System/Library/OpenSSL/cert.pem: Operation not permitted
Failed.
Updating certificates bundle /usr/local/etc/openssl@1.1/cert.pem: Already up to date.

In my other machines brew/openssl relies only on its own cert in /usr/local/etc/openssl/ and not on the /System/Library.OpenSSL certificates;

2nd machine $ rvm osx-ssl-certs status all
.
.
Selected SSL certs for: ruby-1.8.7-head
cURL certificate bundle /usr/share/curl/curl-ca-bundle.crt not found
Certificates bundle /usr/local/etc/openssl/cert.pem is up to date.

Why does the 1st machine check brew + system certs while the second does not? How can I solve this dilemma?


Solution

  • I was able to install gems. I had to recompile all rubies:

    $ rvm uninstall ruby-1.8.7-p374
    $ rvm install ruby-1.8.7-p374 --with-gcc=clang
    $ rvm use ruby-1.8.7-p374@openssl-test01 --create
    $ gem install rdoc-data -v 3.12
    

    After this I was able to install although the link to /System/openssl is still shown in rvm osx-ssl-certs status all.

    MacOS Mojave must have changed something in this particular machine.