Skip to content
This repository has been archived by the owner on Jun 1, 2018. It is now read-only.

Commit

Permalink
add support for ctx.load_verify_locations, refs mitmproxy/mitmproxy#174
Browse files Browse the repository at this point in the history
  • Loading branch information
mhils committed May 20, 2014
1 parent 52c6ba8 commit 66ac565
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions netlib/tcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ def __init__(self, connection, address, server):

def _create_ssl_context(self, cert, key, method=SSLv23_METHOD, options=None,
handle_sni=None, request_client_cert=None, cipher_list=None,
dhparams=None ):
dhparams=None, ca_file=None):
"""
cert: A certutils.SSLCert object.
method: One of SSLv2_METHOD, SSLv3_METHOD, SSLv23_METHOD, or TLSv1_METHOD
Expand Down Expand Up @@ -371,6 +371,8 @@ def _create_ssl_context(self, cert, key, method=SSLv23_METHOD, options=None,
ctx = SSL.Context(method)
if not options is None:
ctx.set_options(options)
if ca_file:
ctx.load_verify_locations(ca_file)
if cipher_list:
try:
ctx.set_cipher_list(cipher_list)
Expand Down Expand Up @@ -450,7 +452,7 @@ def serve_forever(self, poll_interval=0.1):
if ex[0] == EINTR:
continue
else:
raise
raise
if self.socket in r:
connection, client_address = self.socket.accept()
t = threading.Thread(
Expand Down

0 comments on commit 66ac565

Please sign in to comment.