我正在使用MacOS X 10.7.5,由于握手失败,我需要更新的OpenSSL版本.互联网上有几个教程,我尝试了以下内容:
brew install openssl
brew link openssl --force
Run Code Online (Sandbox Code Playgroud)
然而,它不起作用:
openssl version
OpenSSL 0.9.8r 8 Feb 2011
brew unlink openssl && brew link openssl --force
Unlinking /usr/local/Cellar/openssl/1.0.1e... 1139 links removed
Linking /usr/local/Cellar/openssl/1.0.1e... 1139 symlinks created
Run Code Online (Sandbox Code Playgroud)
SVN问题也未解决.有任何想法吗?我宁愿不尝试MacPorts方式,因为它可能会干扰Homebrew.
我正在将REST API用于Cisco CMX设备,并尝试编写Python代码,该代码向API发出GET请求以获取信息.代码如下,除了更改必要的信息外,与文件中的代码相同.
from http.client import HTTPSConnection
from base64 import b64encode
# Create HTTPS connection
c = HTTPSConnection("0.0.0.0")
# encode as Base64
# decode to ascii (python3 stores as byte string, need to pass as ascii
value for auth)
username_password = b64encode(b"admin:password").decode("ascii")
headers = {'Authorization': 'Basic {0}'.format(username_password)}
# connect and ask for resource
c.request('GET', '/api/config/v1/aaa/users', headers=headers)
# response
res = c.getresponse()
data = res.read()
Run Code Online (Sandbox Code Playgroud)
但是,我不断收到以下错误:
Traceback (most recent call last):
File "/Users/finaris/PycharmProjects/test/test/test.py", line 14, in <module>
c.request('GET', '/api/config/v1/aaa/users', …Run Code Online (Sandbox Code Playgroud) 想知道是否有人可以解释openssl如何在python2.7中工作.我不确定python是否有自己的openssl或从本地机器/环境中获取它?
让我解释一下:(如果我在Python中这样做)
>>> import ssl
>>> ssl.OPENSSL_VERSION
'OpenSSL 0.9.8x 10 May 2012'
Run Code Online (Sandbox Code Playgroud)
(在终端)
$ openssl version
OpenSSL 0.9.8x 10 May 2012
$ which openssl
/usr/bin/openssl
Run Code Online (Sandbox Code Playgroud)
现在我更新了openssl(已下载.)
$ cd openssl-1.0.1c
$ ./Configure darwin64-x86_64-cc --prefix=/usr --openssldir=/opt/local/etc/openssl shared
$ make
$ sudo make install
Run Code Online (Sandbox Code Playgroud)
这创建了单独的导演(如指定的那样),因此我将其复制到旧路径中
cp -f /usr/local/ssl/bin/openssl /usr/bin/openssl
Run Code Online (Sandbox Code Playgroud)
现在在终端openssl版本已经更新但不是来自python!
$ openssl version
OpenSSL 1.0.1c 10 May 2012
Run Code Online (Sandbox Code Playgroud)
我注意到.dylib仍然指向旧版本,我该如何更改?
$ ls -l /usr/lib/*ssl*
-rwxr-xr-x 1 root wheel 411680 Jul 17 2012 /usr/lib/libssl.0.9.7.dylib
-rwxr-xr-x 1 root wheel 602800 May 24 03:43 /usr/lib/libssl.0.9.8.dylib
-rwxr-xr-x 1 …Run Code Online (Sandbox Code Playgroud) 我正在尝试安装PHP MongoDB驱动程序,但安装失败,因为它无法找到OpenSSL。
/Users/username/mongo-php-driver/src/libmongoc/src/mongoc/mongoc-crypto-openssl.c:24:10: fatal error: 'openssl/sha.h' file not found
#include <openssl/sha.h>
^
1 error generated.
make: *** [src/libmongoc/src/mongoc/mongoc-crypto-openssl.lo] Error 1
Run Code Online (Sandbox Code Playgroud)
我读到这与最新版本的MacOS有关吗?有没有办法做到这一点,因为我确实需要安装此驱动程序。
我不知道为什么每个https请求都会返回此错误
import requests
requests.get('https://google.com')
requests.exceptions.SSLError: HTTPSConnectionPool(host='google.com', port=443): Max retries exceeded with url: / (Caused by SSLError(SSLError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:833)'),))
Run Code Online (Sandbox Code Playgroud)
即使在Isomnia中,也给我一个与证书有关的错误
我的操作系统是Windows 7 Professional。
我正在尝试根据https://bugs.python.org/issue29095上的说明在macOS 10.11上编译Python 3.6.2 .
我用自制OpenSSL的安装到标准位置,然后加入LDFLAGS,CFLAGS以及CPPFLAGS我ENV:
$ printenv | grep FLAGS
LDFLAGS=/usr/local/Cellar/openssl/1.0.2l/lib/
CFLAGS=-I/usr/local/Cellar/openssl/1.0.2l/include/openssl
CPPFLAGS=-I/usr/local/Cellar/openssl/1.0.2l/include/openssl
Run Code Online (Sandbox Code Playgroud)
然后在同一个shell中,我将Python编译到我的用例所需的自定义位置:
$ sudo ./configure --prefix=/oebuild/python/python-3.6.1
$ sudo make
$ sudo make install
Run Code Online (Sandbox Code Playgroud)
但是,SSL模块无法构建.构建日志说明了这一点:
Python构建成功完成!找不到构建这些可选模块的必要位:_gdbm _ssl ossaudiodev
spwd
要查找必要的位,请在detect_modules()中的setup.py中查找模块的名称.
openssl ×4
python ×4
macos ×3
ssl ×3
certificate ×1
cisco ×1
compilation ×1
homebrew ×1
https ×1
macos-sierra ×1
mongodb ×1
php ×1
request ×1
svn ×1