Commit 2fb480e
committed
issue2551350 - Python changes for 3.12 with roundup 2.3.0 mailer.py
Fix due to change in smtplib.SMTP.starttls() signature.
As of 3.3 it can use an optional ssl context argument for
certificates/keys. In 3.12 it dropped legacy support for specifing
cert/key files as arguments and requires a context.
I modified Andrew's original patch to initialize SSLContext with
ssl.PROTOCOL_TLS_CLIENT.
If there is a cert file specified, enable
check_hostname - verify that the cert supplied by the server matches
the hostname we supplied.
If there is no cert file call
load_default_certs()
Also opened issue2551351 to look into more SMTP ssmtp tightening. We
also should have an option in Roundup to use TLS/SSL (smtps) without
using starttls.
Note that this code is untested by the test suite due to the need to
setup an SMTP server with STARTTLS support. issue2551351 has some
notes on this.1 parent ab3a6f5 commit 2fb480e
2 files changed
+16
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
148 | 151 | | |
149 | 152 | | |
150 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
312 | 313 | | |
313 | 314 | | |
314 | 315 | | |
315 | | - | |
316 | | - | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
317 | 328 | | |
318 | 329 | | |
319 | 330 | | |
| |||
0 commit comments