##// END OF EJS Templates
sslutil: add support for SSLKEYLOGFILE to wrapsocket...
Augie Fackler -
r42455:c8d55ff8 default
parent child Browse files
Show More
@@ -16,6 +16,7 b' import ssl'
16
16
17 from .i18n import _
17 from .i18n import _
18 from . import (
18 from . import (
19 encoding,
19 error,
20 error,
20 node,
21 node,
21 pycompat,
22 pycompat,
@@ -348,6 +349,17 b' def wrapsocket(sock, keyfile, certfile, '
348 if not serverhostname:
349 if not serverhostname:
349 raise error.Abort(_('serverhostname argument is required'))
350 raise error.Abort(_('serverhostname argument is required'))
350
351
352 if b'SSLKEYLOGFILE' in encoding.environ:
353 try:
354 import sslkeylog
355 sslkeylog.set_keylog(pycompat.fsdecode(
356 encoding.environ[b'SSLKEYLOGFILE']))
357 ui.warn(
358 b'sslkeylog enabled by SSLKEYLOGFILE environment variable\n')
359 except ImportError:
360 ui.warn(b'sslkeylog module missing, '
361 b'but SSLKEYLOGFILE set in environment\n')
362
351 for f in (keyfile, certfile):
363 for f in (keyfile, certfile):
352 if f and not os.path.exists(f):
364 if f and not os.path.exists(f):
353 raise error.Abort(
365 raise error.Abort(
General Comments 0
You need to be logged in to leave comments. Login now