Questions tagged «pyopenssl»

20
Python AttributeError:“模块”对象没有属性“ SSL_ST_INIT”
我的Python脚本失败了: Traceback (most recent call last): File "./inspect_sheet.py", line 21, in <module> main() File "./inspect_sheet.py", line 12, in main workbook_name=workbook_name, File "./google_sheets.py", line 56, in __init__ self.login() File "./google_sheets.py", line 46, in login self.client = gspread.authorize(credentials) File "/usr/local/lib/python2.7/site-packages/gspread/client.py", line 335, in authorize client.login() File "/usr/local/lib/python2.7/site-packages/gspread/client.py", line 98, in login self.auth.refresh(http) …

3
为什么尝试使用此代码在TLS上运行TLS时握手失败?
我尝试实现一种协议,该协议可以twisted.protocols.tls使用内存在BIO上与OpenSSL的接口,从而可以使用TLS在TLS上运行TLS 。 我将其实现为协议包装,它看起来像是常规的TCP传输,但是它具有startTLS和stopTLS方法分别用于添加和删除TLS层。这对于TLS的第一层工作正常。如果我在“本机” Twisted TLS传输上运行它,它也可以正常工作。但是,如果我尝试使用startTLS此包装器提供的方法添加第二个TLS层,则会立即出现握手错误,并且连接最终将处于未知的不可用状态。 包装程序和使它工作的两个助手如下所示: from twisted.python.components import proxyForInterface from twisted.internet.error import ConnectionDone from twisted.internet.interfaces import ITCPTransport, IProtocol from twisted.protocols.tls import TLSMemoryBIOFactory, TLSMemoryBIOProtocol from twisted.protocols.policies import ProtocolWrapper, WrappingFactory class TransportWithoutDisconnection(proxyForInterface(ITCPTransport)): """ A proxy for a normal transport that disables actually closing the connection. This is necessary so that when …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.