我有一个Dropbox上传脚本在一个旧的nas盒上,最近我得到了以下错误
SSL certificate error: [Errno 1] _ssl.c:504: error:0D0890A1:asn1 encoding routines:ASN1_verify:unknown message digest algorithm
我想这是因为openssl已经过时了
所以我下载了openssl,从源代码构建并安装了它,现在当我运行下面的代码时,它看起来已经被正确地更新了。
openssl version
OpenSSL 1.0.1h 5 Jun 2014
但看起来Python仍在引用旧版本,我如何更新它?
python -c "import ssl; print ssl.OPENSSL_VERSION"
OpenSSL 0.9.7m 23 Feb 2007
MacOS上的2018 我尝试了其他答案,但没有成功:
--with-brewed-openssl
选项提供Warning: python: this formula has no --with-brewed-openssl option so it will be ignored!
brew link openssl --force
给出Warning: Refusing to link: openssl
我有办法
那么
以及
给了我相同的OpenSSL版本。
过了几天就开始工作了。MAC OS X El Captian或更高版本
现在使用brew再次安装python和openssl。
将以下内容添加到MAC上~/.bash_配置文件中的路径
重新启动终端
(注意:如果安装了Python3,则必须在内联编译器步骤中更新
print
语法)应该提供最新版本的OPEN SSL版本
请参考http://rkulla.blogspot.kr/2014/03/the-path-to-homebrew.html。
我和你一样有同样的问题,所以我找了好几个答案,但都没用。
在通过MAC上的homebrew将openssl升级到1.0.1j之后,系统python仍然引用旧版本0.9.8。结果python引用了openssl。所以我安装了新的python和brewed openssl,并在Mac上完成了这个问题,而不是Ubuntu。
在MacOSX版本10.10和系统Python2.7.6上,我的过程如下。
$ brew update
$ brew install openssl.
然后您可以看到openssl版本1.0.1j$ brew link openssl --force
$ brew install python --with-brewed-openssl.
您必须安装新的带有brewed openssl的python。然后,您可以看到/usr/local/cell/python/2.7.8_2/bin/python。$ sudo ln -s /usr/local/Cellar/python/2.7.8_2/bin/python /usr/local/bin/python.
当然,/usr/local/*应该由$USER拥有,而不是由Ryan告诉的root,但我使用了“sudo”。在这条指令之前,我没有/usr/local/bin/python。在这条指令之后,您可以使用python版本2.7.8而不是2.7.6。最后,你可以看到如下
到目前为止,我正在Ubuntu 12.04上进行这项工作。如果我有Ubuntu12.04的解决方案,那么我会更新我的答案。我希望这个程序对你有帮助。
相关问题 更多 >
编程相关推荐