We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a02fea1 commit 358a4e1Copy full SHA for 358a4e1
Lib/ssl.py
@@ -239,6 +239,14 @@ def _dnsname_match(dn, hostname):
239
raise CertificateError(
240
"wildcard can only be present in left most segment: " + repr(dn))
241
242
+ if wildcards > 1:
243
+ # Issue #17980: avoid denials of service by refusing more
244
+ # than one wildcard per fragment. A survey of established
245
+ # policy among SSL implementations showed it to be a
246
+ # reasonable choice.
247
+ raise CertificateError(
248
+ "too many wildcards in certificate DNS name: " + repr(dn))
249
+
250
# speed up common case w/o wildcards
251
if not wildcards:
252
return dn.lower() == hostname.lower()
0 commit comments