pylint: Skip deprecated-method for match_hostname

Python3.7 switched to
`X509_VERIFY_PARAM_set1_host`/`X509_VERIFY_PARAM_set1_ip`
and deprecated `match_hostname` without replacement. Probably,
on removal `match_hostname` the similar functionality may be
implemented on IPA side.

https://docs.python.org/3/library/ssl.html#ssl.match_hostname

Fixes: https://pagure.io/freeipa/issue/9117
Signed-off-by: Stanislav Levin <slev@altlinux.org>
Reviewed-By: Rob Crittenden <rcritten@redhat.com>
This commit is contained in:
Stanislav Levin 2022-02-21 13:04:26 +03:00 committed by Rob Crittenden
parent 42ff1e0fc2
commit adc7b7cc0b

View File

@ -397,7 +397,10 @@ class IPACertificate:
for value in values: for value in values:
match_san.append(('DNS', value)) match_san.append(('DNS', value))
ssl.match_hostname(match_cert, DNSName(hostname).ToASCII()) # deprecated in Python3.7 without replacement
ssl.match_hostname( # pylint: disable=deprecated-method
match_cert, DNSName(hostname).ToASCII()
)
def load_pem_x509_certificate(data): def load_pem_x509_certificate(data):