9

我正在进入"certificate verify failed (OpenSSL::SSL::SSLError)"我的 ruby​​ 应用程序,并决定是时候在我的 Mac OS X (Mountain Lion) 系统上更新旧的 openssl。

我从这里获取了最新的资源并照常进行

  • ./配置darwin64-x86_64-cc
  • 制作
  • 做测试
  • 须藤使安装

...一切都完成了,没有明显的错误。但我注意到新的 openssl 并没有取代旧的 openssl:

$ which openssl
/usr/bin/openssl
$ /usr/bin/openssl version
OpenSSL 0.9.8x 10 May 2012
$ /usr/local/ssl/bin/openssl version
OpenSSL 1.0.1e 11 Feb 2013

由于害怕破坏现有的东西,我很犹豫要不要弄乱重要的系统文件。推荐的方法是什么?我正在考虑用 /usr/local/ssl/bin 版本的符号链接替换 ​​/usr/bin/openssl 。那行得通吗?

4

1 回答 1

10

To prioritize your local copy over the system copy you need to add it to your shell PATH variable

export PATH="/usr/local/ssl/bin:$PATH"

If you want this to execute every time you start a shell just add it to your .bash_profile in your home directory.

However, this is not going to fix your problem because Ruby would need to be recompiled against the new OpenSSL (we'll assume the updated root certificates file that comes with the new OpenSSL would hypothetically fix this issue). I'd recommend installing either rvm or rbenv and rebuilding ruby. Note that both of those tools would prefer you to install openssl via homebrew.

于 2013-08-21T13:56:00.193 回答