File tree 4 files changed +15
-8
lines changed 4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -324,6 +324,11 @@ BuildRequires: libunistring-devel
324
324
# 0.13.0-2: fix for missing dependency on python-six
325
325
BuildRequires: python3-lesscpy >= 0.13.0-2
326
326
BuildRequires: cracklib-dicts
327
+ %if 0%{?rhel}
328
+ BuildRequires: python3-urllib3 >= 1.24.2-3
329
+ %else
330
+ BuildRequires: python3-urllib3 >= 1.25.8
331
+ %endif
327
332
# ONLY_CLIENT
328
333
%endif
329
334
@@ -569,7 +574,7 @@ Requires: rpm-libs
569
574
%if 0%{?rhel}
570
575
Requires: python3-urllib3 >= 1.24.2-3
571
576
%else
572
- Requires: python3-urllib3 >= 1.25.7
577
+ Requires: python3-urllib3 >= 1.25.8
573
578
%endif
574
579
575
580
%description -n python3-ipaserver
Original file line number Diff line number Diff line change 36
36
import datetime
37
37
import enum
38
38
import ipaddress
39
- import ssl
40
39
import base64
41
40
import re
42
41
53
52
from pyasn1_modules import rfc2315 , rfc2459
54
53
import six
55
54
55
+ try :
56
+ from urllib3 .util import ssl_match_hostname
57
+ except ImportError :
58
+ from urllib3 .packages import ssl_match_hostname
59
+
56
60
from ipalib import errors
57
61
from ipapython .dnsutil import DNSName
58
62
@@ -385,6 +389,7 @@ def san_a_label_dns_names(self):
385
389
return result
386
390
387
391
def match_hostname (self , hostname ):
392
+ # The caller is expected to catch any exceptions
388
393
match_cert = {}
389
394
390
395
match_cert ['subject' ] = match_subject = []
@@ -401,8 +406,7 @@ def match_hostname(self, hostname):
401
406
for value in values :
402
407
match_san .append (('DNS' , value ))
403
408
404
- # deprecated in Python3.7 without replacement
405
- ssl .match_hostname ( # pylint: disable=deprecated-method
409
+ ssl_match_hostname .match_hostname (
406
410
match_cert , DNSName (hostname ).ToASCII ()
407
411
)
408
412
Original file line number Diff line number Diff line change 30
30
import os
31
31
import re
32
32
import shutil
33
- import ssl
34
33
import sys
35
34
import syslog
36
35
import time
@@ -2378,7 +2377,7 @@ def check_ipa_ca_san(cert):
2378
2377
2379
2378
try :
2380
2379
cert .match_hostname (expect )
2381
- except ssl .CertificateError :
2380
+ except x509 . ssl_match_hostname .CertificateError :
2382
2381
raise errors .ValidationError (
2383
2382
name = 'certificate' ,
2384
2383
error = 'Does not have a \' {}\' SAN' .format (expect )
Original file line number Diff line number Diff line change 12
12
import glob
13
13
import shutil
14
14
import fileinput
15
- import ssl
16
15
import stat
17
16
import sys
18
17
import tempfile
@@ -717,7 +716,7 @@ def http_certificate_ensure_ipa_ca_dnsname(http):
717
716
718
717
try :
719
718
cert .match_hostname (expect )
720
- except ssl .CertificateError :
719
+ except x509 . ssl_match_hostname .CertificateError :
721
720
if certs .is_ipa_issued_cert (api , cert ):
722
721
request_id = certmonger .get_request_id (
723
722
{'cert-file' : paths .HTTPD_CERT_FILE })
You can’t perform that action at this time.
0 commit comments