【发布时间】:2016-12-04 20:21:52
【问题描述】:
我正在使用:OSX 10.11.6,Homebrew 版本 0.9.9m OpenSSL 0.9.8zg 2015 年 7 月 14 日
我正在尝试使用 dotnetcore 并关注他们的instructions,
我已经升级/安装了最新版本的 openssl:
> brew install openssl
==> Downloading https://homebrew.bintray.com/bottles/openssl-1.0.2h_1.el_capitan.bottle.tar.gz
Already downloaded: /Users/administrator/Library/Caches/Homebrew/openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Pouring openssl-1.0.2h_1.el_capitan.bottle.tar.gz
==> Caveats
A CA file has been bootstrapped using certificates from the system
keychain. To add additional certificates, place .pem files in
/usr/local/etc/openssl/certs
and run
/usr/local/opt/openssl/bin/c_rehash
This formula is keg-only, which means it was not symlinked into /usr/local.
Apple has deprecated use of OpenSSL in favor of its own TLS and crypto libraries
Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:
LDFLAGS: -L/usr/local/opt/openssl/lib
CPPFLAGS: -I/usr/local/opt/openssl/include
但是当我尝试链接 openssl 时,我继续遇到此链接错误:
> brew link --force openssl
Warning: Refusing to link: openssl
Linking keg-only OpenSSL means you may end up linking against the insecure,
deprecated system version while using the headers from the Homebrew version.
Instead, pass the full include/library paths to your compiler e.g.:
-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib
包含编译器标志的选项对我来说没有意义,因为我没有编译我所依赖的这些库。
EDIT dotnetcore 更新了他们的说明:
brew update
brew install openssl
ln -s /usr/local/opt/openssl/lib/libcrypto.1.0.0.dylib /usr/local/lib/
ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
【问题讨论】:
-
对于 .NET Core,您需要受支持的 OpenSSL 版本,即 1.0.1 或 1.0.2 版本。既然您要报告 0.9.8 版本,也许您需要先
brew upgrade openssl? -
我已经这样做了。我应该澄清一下,但我没有将这些步骤添加到问题中。但我已经完成了
brew update和brew install openssl。这是尝试安装支持的版本。 -
Homebrew 似乎已明确阻止它:github.com/Homebrew/brew/commit/…。
-
而且.. 继续完善我的闲聊,您可能会对 github.com/Homebrew/brew/pull/597 上的任何发展感兴趣
-
"...当我尝试链接 openssl 时,我继续遇到此链接错误:.." - 另请参阅 How to set the runtime path (-rpath) of an executable with gcc under Mac OSX?。如果 Brew 没有添加它,它可能会帮助您始终在运行时加载正确的库。
标签: macos openssl homebrew .net-core