dav*_*ath 122 macos homebrew openssl .net-core
我在:OSX 10.11.6,Homebrew版本0.9.9m OpenSSL 0.9.8zg 2015年7月14日
我正在尝试使用dotnetcore并遵循他们的指示,
我升级/安装了最新版本的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
Run Code Online (Sandbox Code Playgroud)
但是当我尝试链接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
Run Code Online (Sandbox Code Playgroud)
包含编译器标志的选项对我没有意义,因为我没有编译我依赖的这些库.
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/
Run Code Online (Sandbox Code Playgroud)
Ben*_*ins 60
正如对其他答案的更新所示,安装旧的openssl101 brew的解决方法将不再有效.有关现在的解决方法,请参阅dotnet/cli#3964上的此评论.
此处复制的问题中最相关的部分:
我查看了建议在库上设置rpath的另一个选项.我认为以下是一个更好的解决方案,只会影响这个特定的库.
sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Security.Cryptography.Native.dylib和/或如果安装了NETCore 1.0.1,也要为1.0.1执行相同的命令:
sudo install_name_tool -add_rpath /usr/local/opt/openssl/lib /usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.1/System.Security.Cryptography.Native.dylib实际上,我们告诉dotnet如何找到正确的库,而不是告诉操作系统总是使用自制的SSL版本并可能导致某些内容破坏.
同样重要的是,它看起来像微软都意识到这个问题,并和既有)有点无计划减轻以及B)一个长期的解决方案(probaby用的dotnet捆绑的OpenSSL).
另一件需要注意的事情是:/usr/local/opt/openssl/libbrew默认链接的位置:
13:22 $ ls -l /usr/local/opt/openssl
lrwxr-xr-x 1 ben admin 26 May 15 14:22 /usr/local/opt/openssl -> ../Cellar/openssl/1.0.2h_1
Run Code Online (Sandbox Code Playgroud)
如果无论出于何种原因安装brew并将其链接到不同的位置,那么该路径就是您应该用作rpath的路径.
一旦更新了System.Security.Cryptography.Native.dylib libray的rpath,就需要重新启动交互式会话(即关闭控制台并启动另一个控制台).
ror*_*ler 51
这对我有用:
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/
ln -s /usr/local/Cellar/openssl/1.0.2j/bin/openssl /usr/local/bin/openssl
Run Code Online (Sandbox Code Playgroud)
感谢@dorlandode在这个帖子上https://github.com/Homebrew/brew/pull/597
注意:我只使用它作为临时修复,直到我可以花时间从头开始正确安装Openssl.我记得在我意识到最好的方法是手动安装我需要的证书之前,我花了一天时间调试并遇到问题.在尝试此操作之前,请阅读@ bouke的评论中的链接.
小智 45
在OS X El Capitan 10.11.6上,这些解决方案都不适用于我.可能是因为OS X有一个本机版本的openssl,它认为它是优越的,因此,不喜欢篡改.
所以,我走上了高路,开始新鲜......
cd /usr/local/src
Run Code Online (Sandbox Code Playgroud)
如果您收到"没有此类文件或目录",请将其设为:
cd /usr/local && mkdir src && cd src
下载openssl:
curl --remote-name https://www.openssl.org/source/openssl-1.0.2h.tar.gz
Run Code Online (Sandbox Code Playgroud)
提取并cd入:
tar -xzvf openssl-1.0.2h.tar.gz
cd openssl-1.0.2h
Run Code Online (Sandbox Code Playgroud)
编译并安装:
./configure darwin64-x86_64-cc --prefix=/usr/local/openssl-1.0.2h shared
make depend
make
make install
Run Code Online (Sandbox Code Playgroud)
现在符号链接OS X的openssl到你的新的和更新的openssl:
ln -s /usr/local/openssl-1.0.2h/bin/openssl /usr/local/bin/openssl
Run Code Online (Sandbox Code Playgroud)
关闭终端,打开一个新会话,并验证OS X正在使用您的新openssl:
openssl version -a
Run Code Online (Sandbox Code Playgroud)
小智 40
只需执行brew info openssl并阅读其中所说的信息:
如果您需要在PATH运行中首先使用此软件:
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
tob*_*bot 14
我迁移了我的mac,它取消了我所有的自制软件安装 - 包括OpenSSL.这打破了gem install,这是我第一次注意到这个问题并开始尝试修复它.
经过一百万个解决方案(迁移到OSX Sierra - 10.12.5)后,解决方案最终变得非常简单:
brew reinstall ruby
brew reinstall openssl
Run Code Online (Sandbox Code Playgroud)
在尝试了我能找到的所有内容并且没有任何效果之后,我就试过了:
touch ~/.bash_profile; open ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)
在文件里面添加了这一行.
export PATH="$PATH:/usr/local/Cellar/openssl/1.0.2j/bin/openssl"
Run Code Online (Sandbox Code Playgroud)
现在它的工作:)
Jorns-iMac:~ jorn$ openssl version -a
OpenSSL 1.0.2j 26 Sep 2016
built on: reproducible build, date unspecified
//blah blah
OPENSSLDIR: "/usr/local/etc/openssl"
Jorns-iMac:~ jorn$ which openssl
/usr/local/opt/openssl/bin/openssl
Run Code Online (Sandbox Code Playgroud)
我有类似的情况.我需要通过brew安装openssl然后使用pip来安装mitmproxy.我得到同样的抱怨brew link --force.以下是我达成的解决方案:(没有通过brew强制链接)
LDFLAGS=-L/usr/local/opt/openssl/lib
CPPFLAGS=-I/usr/local/opt/openssl/include
PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig
pip install mitmproxy
Run Code Online (Sandbox Code Playgroud)
这并没有直截了当地解决这个问题.如果有人使用pip并且需要openssl lib,我会离开单行.
注意:/usr/local/opt/openssl/lib路径是通过获得的brew info openssl
小智 7
这对我有用:
brew install openssl
cd /usr/local/include
ln -s ../opt/openssl/include/openssl .
Run Code Online (Sandbox Code Playgroud)
小智 6
edwardthesecond上面的解决方案也适用于Sierra
brew install openssl
cd /usr/local/include
ln -s ../opt/openssl/include/openssl
./configure && make
Run Code Online (Sandbox Code Playgroud)
我之前做的其他步骤是:
通过brew安装openssl
brew install openssl
Run Code Online (Sandbox Code Playgroud)根据自制软件的建议将openssl添加到路径中
brew info openssl
echo 'export PATH="/usr/local/opt/openssl/bin:$PATH"' >> ~/.bash_profile
Run Code Online (Sandbox Code Playgroud)| 归档时间: |
|
| 查看次数: |
99587 次 |
| 最近记录: |