Skip to content

bpo-38470: Add hostname support to ssl.get_server_certificate. - #16819

Closed
juhovh wants to merge 1 commit into
python:masterfrom
juhovh:fix-issue-36076
Closed

bpo-38470: Add hostname support to ssl.get_server_certificate.#16819
juhovh wants to merge 1 commit into
python:masterfrom
juhovh:fix-issue-36076

Conversation

@juhovh

@juhovh juhovh commented Oct 16, 2019

Copy link
Copy Markdown
Contributor

Many servers in the cloud environment require SNI to be used during the
SSL/TLS handshake, therefore it is not possible to fetch their certificates
using the ssl.get_server_certificate interface.

This change adds an additional optional hostname argument that can be used to
set the SNI. Note that it is intentionally a separate argument instead of
using the host part of the addr tuple, because one might want to explicitly
fetch the default certificate or fetch a certificate from a specific IP
address with the specified SNI hostname. A separate argument also works better
for backwards compatibility.

https://bugs.python.org/issue38470

Many servers in the cloud environment require SNI to be used during the
SSL/TLS handshake, therefore it is not possible to fetch their certificates
using the ssl.get_server_certificate interface.

This change adds an additional optional hostname argument that can be used to
set the SNI. Note that it is intentionally a separate argument instead of
using the host part of the addr tuple, because one might want to explicitly
fetch the default certificate or fetch a certificate from a specific IP
address with the specified SNI hostname. A separate argument also works better
for backwards compatibility.
@juhovh

juhovh commented Oct 16, 2019

Copy link
Copy Markdown
Contributor Author

Accidentally had invalid bpo issue name. 😓 Will close this and re-open a new one.

@juhovh juhovh closed this Oct 16, 2019
@juhovh
juhovh deleted the fix-issue-36076 branch October 16, 2019 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants