def __init__(self, max_window=4, timeout=8, proxy='', ssl_ciphers=None, max_retry=2):
# http://docs.python.org/dev/library/ssl.html
# http://blog.ivanristic.com/2009/07/examples-of-the-information-collected-from-ssl-handshakes.html
# http://src.chromium.org/svn/trunk/src/net/third_party/nss/ssl/sslenum.c
# http://www.openssl.org/docs/apps/ciphers.html
# openssl s_server -accept 443 -key CA.crt -cert CA.crt
# set_ciphers as Modern Browsers
BaseHTTPUtil.__init__(self, GC.LINK_OPENSSL, os.path.join(cert_dir, 'cacerts'), ssl_ciphers)
self.max_window = max_window
self.max_retry = max_retry
self.timeout = timeout
self.proxy = proxy
self.tcp_connection_time = LRUCache(512 if self.gws else 4096)
self.ssl_connection_time = LRUCache(512 if self.gws else 4096)
if self.gws and GC.GAE_ENABLEPROXY:
self.gws_front_connection_time = LRUCache(128)
self.gws_front_connection_time.set('ip', LRUCache(128), noexpire=True)
self.create_ssl_connection = self.create_gws_connection_withproxy
#if self.proxy:
# dns_resolve = self.__dns_resolve_withproxy
# self.create_connection = self.__create_connection_withproxy
# self.create_ssl_connection = self.__create_ssl_connection_withproxy
评论列表
文章目录