Read ssl_verify and timeout values from the config file#4
Open
peterguy wants to merge 2 commits intoderJD:mainfrom
Open
Read ssl_verify and timeout values from the config file#4peterguy wants to merge 2 commits intoderJD:mainfrom
peterguy wants to merge 2 commits intoderJD:mainfrom
Conversation
When an instance of MailCow is created, read the values for `ssl_verify` and `timeout` from the first of these to return a non-empty value: 0. kwargs 1. config file, "defaults" section 2. config file, current server section 3. globals constant
If connecting to a Mailcow instance that's using a self-signed (or otherwise invalid) certificate, Python will emit a warning. If ssl_verify is False, we want to connect anyway, so suppress that warning.
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.
Currently,
ssl_verifyandtimeoutare being read only from theglobalsconstants. Read them from the config file, usingglobalsif the config file does not include the setting.When reading
ssl_verifyfrom the config file, treat the case-insensitive values "false", "no" and "f" asFalse; treat all other values asTrue.When reading
timeoutfrom the config file, assume Integer values.When using
ssl_verify = False, suppress warnings about self-signed (or otherwise untrusted or invalid certificates) when connecting.