[issue36094] When using an SMTP SSL connection,, get ValueError.

Peter Stokes report at bugs.python.org
Fri Sep 4 05:52:53 EDT 2020


Peter Stokes <linux at dadeos.co.uk> added the comment:

I wanted to enquire as to if/when the proposed PR11998 is likely to be merged?

I also wanted to note the similarity between this issue and issue41470 and to suggest that whilst the change proposed in commit e445ccbc of PR11998 [1] would be welcome, there may be a case for exposing the value ultimately passed as the `server_hostname` parameter to the `SSLContext.wrap_socket(…)` call [2] as a parameter to `SMTP.connect(…)` [3]. Doing so would aid potential use cases whereby the `host` parameter provided is an address, yet the TLS server hostname validation should be based upon another value (i.e. the hostname); potentially useful in scenarios where the `host`'s address has been previously derived, by the caller, by other means (e.g. a call to `socket.getaddrinfo(…)` [4]).

[1] https://github.com/python/cpython/pull/11998/commits/e445ccbc483dfde74638dbb694132dc00ced4973
[2] https://docs.python.org/3/library/ssl.html#ssl.SSLContext.wrap_socket
[3] https://docs.python.org/3/library/smtplib.html#smtplib.SMTP.connect
[4] https://docs.python.org/3/library/socket.html#socket.getaddrinfo

----------
nosy: +Dadeos

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue36094>
_______________________________________


More information about the Python-bugs-list mailing list