如何禁用OpenSSL版本validation

我使用docker -py和dockerpty来连接并执行ucp中的容器中的命令。 一切工作正常,除非我试图劫持在容器中分配的伪terminal:

 import docker import dockerpty import requests client = docker.Client() container = client.create_container( image='busybox:latest', stdin_open=True, tty=True, command='/bin/sh', ) requests.packages.urllib3.disable_warnings() command = "/bin/bash" dockerpty.exec_command(client, container, command) 

但是,当我执行命令,我可以连接到远程terminal,但是当我inputterminal时,我得到:

 File "build/bdist.macosx-10.12-x86_64/egg/dockerpty/__init__.py", line 44, in exec_command File "build/bdist.macosx-10.12-x86_64/egg/dockerpty/pty.py", line 334, in start File "build/bdist.macosx-10.12-x86_64/egg/dockerpty/pty.py", line 373, in _hijack_tty File "build/bdist.macosx-10.12-x86_64/egg/dockerpty/io.py", line 367, in flush File "build/bdist.macosx-10.12-x86_64/egg/dockerpty/io.py", line 120, in read File "/usr/local/lib/python2.7/site-packages/requests/packages/urllib3/contrib/pyopenssl.py", line 194, in recv data = self.connection.recv(*args, **kwargs) File "build/bdist.macosx-10.11-x86_64/egg/OpenSSL/SSL.py", line 1320, in recv File "build/bdist.macosx-10.11-x86_64/egg/OpenSSL/SSL.py", line 1187, in _raise_ssl_error File "build/bdist.macosx-10.11-x86_64/egg/OpenSSL/_util.py", line 48, in exception_from_error_queue OpenSSL.SSL.Error: [('SSL routines', 'ssl3_read_bytes', 'tlsv1 alert protocol version')] 

我的openssl版本是:

 $ openssl version OpenSSL 1.0.2j 26 Sep 2016 

而容器有:

 # openssl version OpenSSL 1.0.1t 3 May 2016 

那么,两者都在1.0.1以上。 所有我需要的是禁用版本validation。 随着requests库,我可以做:

 import requests response = requests.get(<https url>, verify=False) 

我的Python版本是2.7.12SSL

 >>> import ssl >>> print ssl.OPENSSL_VERSION OpenSSL 1.0.2j 26 Sep 2016 

也是最新的。 该容器有Python 2.7.9SSL

 >>> import ssl >>> print ssl.OPENSSL_VERSION OpenSSL 1.0.1t 3 May 2016 

我正要从dockerpty创build一个fork,并自己添加更改,除非有人有更好的build议。 我能做些什么来解决这个问题?