Skip to content

Commit a8fb42e

Browse files
committed
improve documentation
1 parent 358a4e1 commit a8fb42e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Lib/ssl.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,7 @@ def _dnsname_match(dn, hostname):
234234

235235
wildcards = leftmost.count('*')
236236
if wildcards == 1 and len(leftmost) > 1:
237-
""" Only match wildcard in leftmost segment.
238-
"""
237+
# Only match wildcard in leftmost segment.
239238
raise CertificateError(
240239
"wildcard can only be present in left most segment: " + repr(dn))
241240

Lib/test/test_ssl.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ def fail(cert, hostname):
512512
fail(cert, 'Xa.com')
513513
fail(cert, '.a.com')
514514

515-
# only match wildcard in left-most segment
515+
# only match wildcards when they are the only thing
516+
# in left-most segment
516517
cert = {'subject': ((('commonName', 'f*.com'),),)}
517518
fail(cert, 'foo.com')
518519
fail(cert, 'f.com')

0 commit comments

Comments
 (0)