+
+
+if hasattr(__ssl, 'SSLContext'):
+ @functools.wraps(__ssl.SSLContext.wrap_socket)
+ def _green_sslcontext_wrap_socket(self, sock, *a, **kw):
+ return GreenSSLSocket(sock, *a, _context=self, **kw)
+
+ # FIXME:
+ # * GreenSSLContext akin to GreenSSLSocket
+ # * make ssl.create_default_context() use modified SSLContext from globals as usual
+ __ssl.SSLContext.wrap_socket = _green_sslcontext_wrap_socket