mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-27 02:24:18 +00:00
make cert and key mandatory
This commit is contained in:
parent
a8345af282
commit
71834aeab1
@ -391,12 +391,12 @@ class BaseHandler(_Connection):
|
|||||||
ctx.set_verify(SSL.VERIFY_PEER, ver)
|
ctx.set_verify(SSL.VERIFY_PEER, ver)
|
||||||
return ctx
|
return ctx
|
||||||
|
|
||||||
def convert_to_ssl(self, **kwargs):
|
def convert_to_ssl(self, cert, key, **sslctx_kwargs):
|
||||||
"""
|
"""
|
||||||
Convert connection to SSL.
|
Convert connection to SSL.
|
||||||
For a list of parameters, see BaseHandler._create_ssl_context(...)
|
For a list of parameters, see BaseHandler._create_ssl_context(...)
|
||||||
"""
|
"""
|
||||||
ctx = self._create_ssl_context(**kwargs)
|
ctx = self._create_ssl_context(cert, key, **sslctx_kwargs)
|
||||||
self.connection = SSL.Connection(ctx, self.connection)
|
self.connection = SSL.Connection(ctx, self.connection)
|
||||||
self.ssl_established = True
|
self.ssl_established = True
|
||||||
self.connection.set_accept_state()
|
self.connection.set_accept_state()
|
||||||
|
Loading…
Reference in New Issue
Block a user