Add optional srvhostname argument for managesieve client #126
Merged
Conversation
…assing differnt server_hostname to ssllib context
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #126 +/- ##
=======================================
Coverage 87.55% 87.56%
=======================================
Files 10 10
Lines 2073 2074 +1
=======================================
+ Hits 1815 1816 +1
Misses 258 258 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Owner
|
@wildegnux Thanks for this contribution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add optional srvhostname argument for managesieve client to support passing differnt server_hostname to ssllib context.
My use case is the following.
I'm using this library for a test that managesieve (dovecot pigeonhole) is working as expected with TLS for a hostname. The hostname resolves to two ip addresses and I want to test each ip address individually.
The certificate served by dovecot is valid for the hostname, not the IP addresses and thus if I try connecting without this patch I would get the following error:
sievelib.managesieve.Error: SSL error: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: IP address mismatch, certificate is not valid for '1.2.3.4'. (_ssl.c:1032)passing the correct hostname instead of the ip to the sslib context fixes this.