Skip to content

Commit

Permalink
must pass server_hostname when using default context
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Wullinger committed Apr 15, 2024
1 parent 89dc883 commit 21f0cde
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sievelib/managesieve.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ def __starttls(self, keyfile=None, certfile=None) -> bool:
context.load_cert_chain(certfile, keyfile=keyfile)

Check warning on line 486 in sievelib/managesieve.py

View check run for this annotation

Codecov / codecov/patch

sievelib/managesieve.py#L484-L486

Added lines #L484 - L486 were not covered by tests
try:
# nsock = ssl.wrap_socket(self.sock, keyfile, certfile)
nsock = context.wrap_socket(self.sock)
nsock = context.wrap_socket(self.sock, server_hostname=self.srvaddr)

Check warning on line 489 in sievelib/managesieve.py

View check run for this annotation

Codecov / codecov/patch

sievelib/managesieve.py#L489

Added line #L489 was not covered by tests
except ssl.SSLError as e:
raise Error("SSL error: %s" % str(e))
self.sock = nsock
Expand Down

0 comments on commit 21f0cde

Please sign in to comment.