mirror of
https://github.com/Tautulli/Tautulli.git
synced 2025-07-16 02:02:58 -07:00
Merge pull request #1181 from felixbuenemann/fix-cherrypy-ssl-connection-type-deprecation
Fix OpenSSL SSL.ConnectionType deprecation warning
This commit is contained in:
commit
450fda18f1
1 changed files with 5 additions and 1 deletions
|
@ -39,6 +39,10 @@ from cherrypy import wsgiserver
|
||||||
try:
|
try:
|
||||||
from OpenSSL import SSL
|
from OpenSSL import SSL
|
||||||
from OpenSSL import crypto
|
from OpenSSL import crypto
|
||||||
|
if hasattr(SSL, 'Connection'):
|
||||||
|
SSLConnectionType = SSL.Connection
|
||||||
|
else:
|
||||||
|
SSLConnectionType = SSL.ConnectionType
|
||||||
except ImportError:
|
except ImportError:
|
||||||
SSL = None
|
SSL = None
|
||||||
|
|
||||||
|
@ -244,7 +248,7 @@ class pyOpenSSLAdapter(wsgiserver.SSLAdapter):
|
||||||
return ssl_environ
|
return ssl_environ
|
||||||
|
|
||||||
def makefile(self, sock, mode='r', bufsize=-1):
|
def makefile(self, sock, mode='r', bufsize=-1):
|
||||||
if SSL and isinstance(sock, SSL.ConnectionType):
|
if SSL and isinstance(sock, SSLConnectionType):
|
||||||
timeout = sock.gettimeout()
|
timeout = sock.gettimeout()
|
||||||
f = SSL_fileobject(sock, mode, bufsize)
|
f = SSL_fileobject(sock, mode, bufsize)
|
||||||
f.ssl_timeout = timeout
|
f.ssl_timeout = timeout
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue