starfry
starfry

Reputation: 9953

Undefined symbol: SSLv3_method - .../openssl.so with Ruby and ArchLinux

A recent OpenSSL update on ArchLinux broke Ruby because the latter depends on SSLv3 being supported by the former. Ruby code that uses OpenSSL will reveal the problem when they terminate with an error like the below:

openssl.so: undefined symbol: SSLv3_method - .../openssl.so (LoadError)

I use multiple versions of Ruby with RVM and the problem aplies to all of them.

The OpenSSL version I have the problem with is 1.0.2h but I believe it was introduced with 1.0.2g. Version 1.0.2f works fine.

How can this be compatibility issue be overcome (without downgradng OpenSSL) ?

Upvotes: 9

Views: 3997

Answers (1)

starfry
starfry

Reputation: 9953

The problem is caused by the ArchLinux OpenSSL package being built without SSLv3 support, as of this commit. I believe that a similar thing has been done in other distros such as Ubuntu.

The solution in a RVM environment is to reinstall your Rubies which will rebuild them (you may also wish to update to the latest rvm):

$ rvm get head        # optional, if you want to!
$ rvm reinstall all   # or a specifc ruby version instead of 'all'

However, older rubies will still fail with a compile error like this:

Error running '__rvm_make -j1'
ossl_ssl.c:143:27: error: ‘SSLv3_client_method’ undeclared here (not in a function)

This has been discussed with the RVM team who have suggested installing this Ruby patch that allows older rubies to build:

$ curl https://github.com/ruby/ruby/commit/801e1fe46d83c856844ba18ae4751478c59af0d1.diff > openssl.patch
$ rvm install --patch ./openssl.patch 1.9.3-p194

I built ruby-1.9.3-p194, ruby-2.0.0-p247 and ruby-2.2.1 successfully with this patch.

Upvotes: 15

Related Questions