未定义的符号:使用Ruby和ArchLinux的SSLv3_method - ... / openssl.so

时间:2016-05-21 10:46:43

标签: ruby openssl rvm archlinux

最近在ArchLinux上的OpenSSL更新破坏了Ruby,因为后者依赖于前者支持的SSLv3。使用OpenSSL的Ruby代码将在终止时出现如下错误的问题:

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

我使用带有RVM的多个Ruby版本,问题适用于所有版本。

我遇到问题的OpenSSL版本是1.0.2h,但我相信它是1.0.2g引入的。版本1.0.2f运行正常。

如何克服兼容性问题(没有降级OpenSSL )?

1 个答案:

答案 0 :(得分:14)

问题是由于this commit之前没有支持SSLv3而构建的ArchLinux OpenSSL包引起的。我相信在Ubuntu等其他发行版中也做过类似的事情。

RVM环境中的解决方案是重新安装将重建它们的Rubies(您可能还希望更新到最新的rvm):

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

但是,旧的rubies仍然会因为编译错误而失败:

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

对于已建议安装discussed的RVM团队,这已经this Ruby patch,允许旧版红宝石构建:

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

我使用此修补程序成功构建了ruby-1.9.3-p194ruby-2.0.0-p247ruby-2.2.1