D6343: sslutil: add support for SSLKEYLOGFILE to wrapsocket

durin42 (Augie Fackler) phabricator at mercurial-scm.org
Fri May 10 12:01:31 EDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc8d55ff80da1: sslutil: add support for SSLKEYLOGFILE to wrapsocket (authored by durin42, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6343?vs=15010&id=15048

REVISION DETAIL
  https://phab.mercurial-scm.org/D6343

AFFECTED FILES
  mercurial/sslutil.py

CHANGE DETAILS

diff --git a/mercurial/sslutil.py b/mercurial/sslutil.py
--- a/mercurial/sslutil.py
+++ b/mercurial/sslutil.py
@@ -16,6 +16,7 @@
 
 from .i18n import _
 from . import (
+    encoding,
     error,
     node,
     pycompat,
@@ -348,6 +349,17 @@
     if not serverhostname:
         raise error.Abort(_('serverhostname argument is required'))
 
+    if b'SSLKEYLOGFILE' in encoding.environ:
+        try:
+            import sslkeylog
+            sslkeylog.set_keylog(pycompat.fsdecode(
+                encoding.environ[b'SSLKEYLOGFILE']))
+            ui.warn(
+                b'sslkeylog enabled by SSLKEYLOGFILE environment variable\n')
+        except ImportError:
+            ui.warn(b'sslkeylog module missing, '
+                    b'but SSLKEYLOGFILE set in environment\n')
+
     for f in (keyfile, certfile):
         if f and not os.path.exists(f):
             raise error.Abort(



To: durin42, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list