Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read ssl_verify and timeout values from the config file #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

peterguy
Copy link

@peterguy peterguy commented Oct 5, 2022

Currently, ssl_verify and timeout are being read only from the globals constants. Read them from the config file, using globals if the config file does not include the setting.
When reading ssl_verify from the config file, treat the case-insensitive values "false", "no" and "f" as False; treat all other values as True.
When reading timeout from the config file, assume Integer values.

When using ssl_verify = False, suppress warnings about self-signed (or otherwise untrusted or invalid certificates) when connecting.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant