Skip to content

Commit

Permalink
Use cert_path and ca_path arguments in load_cert_chain
Browse files Browse the repository at this point in the history
  • Loading branch information
François Rossigneux committed Nov 30, 2018
1 parent 81c8360 commit 92398fd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion parsec/backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,10 @@ async def _do_handshake(self, sock):

async def handle_client_with_ssl(self, cert_path, ca_path, stream, swallow_crash=False):
ssl_context = trio.ssl.create_default_context(trio.ssl.Purpose.CLIENT_AUTH)
ssl_context.load_default_certs()
if cert_path and ca_path:
ssl_context.load_cert_chain(cert_path, ca_path)
else:
ssl_context.load_default_certs()
ssl_stream = trio.ssl.SSLStream(stream, ssl_context, server_side=True)
await self.handle_client(ssl_stream, swallow_crash=swallow_crash)

Expand Down

0 comments on commit 92398fd

Please sign in to comment.