Skip to content

bpo-36076: Add SNI support to ssl.get_server_certificate. (GH-16820)#482

Merged
sthagen merged 1 commit into
sthagen:masterfrom
python:master
Apr 18, 2021
Merged

bpo-36076: Add SNI support to ssl.get_server_certificate. (GH-16820)#482
sthagen merged 1 commit into
sthagen:masterfrom
python:master

Conversation

@sthagen
Copy link
Copy Markdown
Owner

@sthagen sthagen commented Apr 18, 2021

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.

Automerge-Triggered-By: GH:tiran

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.

Automerge-Triggered-By: GH:tiran
@sthagen sthagen merged commit 9387f33 into sthagen:master Apr 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants