Show More
@@ -93,6 +93,7 b' def main():' | |||
|
93 | 93 | op.add_option('--pid-file', metavar='FILE') |
|
94 | 94 | op.add_option('--tls', choices=['none', 'smtps'], default='none') |
|
95 | 95 | op.add_option('--certificate', metavar='FILE') |
|
96 | op.add_option('--logfile', metavar='FILE') | |
|
96 | 97 | |
|
97 | 98 | opts, args = op.parse_args() |
|
98 | 99 | if opts.tls == 'smtps' and not opts.certificate: |
@@ -113,6 +114,7 b' def main():' | |||
|
113 | 114 | runfn=run, |
|
114 | 115 | runargs=[pycompat.sysexecutable, pycompat.fsencode(__file__)] |
|
115 | 116 | + pycompat.sysargv[1:], |
|
117 | logfile=opts.logfile, | |
|
116 | 118 | ) |
|
117 | 119 | |
|
118 | 120 |
@@ -5,7 +5,7 b' Set up SMTP server:' | |||
|
5 | 5 | $ CERTSDIR="$TESTDIR/sslcerts" |
|
6 | 6 | $ cat "$CERTSDIR/priv.pem" "$CERTSDIR/pub.pem" >> server.pem |
|
7 | 7 | |
|
8 | $ "$PYTHON" "$TESTDIR/dummysmtpd.py" -p $HGPORT --pid-file a.pid -d \ | |
|
8 | $ "$PYTHON" "$TESTDIR/dummysmtpd.py" -p $HGPORT --pid-file a.pid --logfile log -d \ | |
|
9 | 9 | > --tls smtps --certificate `pwd`/server.pem |
|
10 | 10 | listening at localhost:$HGPORT (?) |
|
11 | 11 | $ cat a.pid >> $DAEMON_PIDS |
@@ -75,6 +75,10 b' Without certificates:' | |||
|
75 | 75 | (see https://mercurial-scm.org/wiki/SecureConnections for how to configure Mercurial to avoid this error or set hostsecurity.localhost:fingerprints=sha256:20:de:b3:ad:b4:cd:a5:42:f0:74:41:1c:a2:70:1e:da:6e:c0:5c:16:9e:e7:22:0f:f1:b7:e5:6e:e4:92:af:7e to trust this server) |
|
76 | 76 | [150] |
|
77 | 77 | |
|
78 | $ cat ../log | |
|
79 | * ssl error (glob) | |
|
80 | $ : > ../log | |
|
81 | ||
|
78 | 82 | With global certificates: |
|
79 | 83 | |
|
80 | 84 | $ try --debug --config web.cacerts="$CERTSDIR/pub.pem" |
@@ -86,6 +90,10 b' With global certificates:' | |||
|
86 | 90 | (verifying remote certificate) |
|
87 | 91 | sending [PATCH] a ... |
|
88 | 92 | |
|
93 | $ cat ../log | |
|
94 | * from=quux to=foo, bar (glob) | |
|
95 | $ : > ../log | |
|
96 | ||
|
89 | 97 | With invalid certificates: |
|
90 | 98 | |
|
91 | 99 | $ try --config web.cacerts="$CERTSDIR/pub-other.pem" |
@@ -96,4 +104,8 b' With invalid certificates:' | |||
|
96 | 104 | (?i)abort: .*?certificate.verify.failed.* (re) |
|
97 | 105 | [255] |
|
98 | 106 | |
|
107 | $ cat ../log | |
|
108 | * ssl error (glob) | |
|
109 | $ : > ../log | |
|
110 | ||
|
99 | 111 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now