【问题标题】:Undefined symbol: SSLv3_method - .../openssl.so with Ruby and ArchLinux未定义符号:SSLv3_method - .../openssl.so 与 Ruby 和 ArchLinux
【发布时间】:2016-05-21 10:46:43
【问题描述】:

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

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

我将多个版本的 Ruby 与 RVM 一起使用,并且问题适用于所有版本。

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

如何克服兼容性问题(无需降级 OpenSSL)?

【问题讨论】:

  • 同样的发行版,同样的问题。

标签: ruby openssl rvm archlinux


【解决方案1】:

这个问题是由于 ArchLinux OpenSSL 包在没有 SSLv3 支持的情况下构建的,截至this commit。我相信在其他发行版(例如 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)

这是 RVM 团队的discussed,他们建议安装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

【讨论】:

  • 如果其他人必须在相同条件下构建 Ruby 1.8,这里有一个有效的补丁:gist.githubusercontent.com/sigmike/…
  • 可以确认来自@MichaëlWitrant 的补丁也适用于 1.9.2-p290
  • 实际上the bug 已在ruby-3.0 中修复,并向后移植到ruby-2.1.8ruby-2.2.4git log -p v2_2_9..v2_3_0 --grep 11376, git log -p v2_1_7..v2_1_8 --grep 11376, git log -p v2_2_3..v2_2_4 --grep 11376.
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2018-11-25
  • 2012-01-04
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-10-17
  • 1970-01-01
相关资源
最近更新 更多