Enable working TLS to smtp.office365.com #166
Merged
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.
To avoid the error:
app_1 | Traceback (most recent call last):
app_1 | File "/app/notifiers/smtp.py", line 38, in init
app_1 | self._connect()
app_1 | File "/app/notifiers/smtp.py", line 53, in _connect
app_1 | self.server = smtplib.SMTP_SSL(self.host, self.port)
app_1 | File "/usr/local/lib/python3.9/smtplib.py", line 1050, in init
app_1 | SMTP.init(self, host, port, local_hostname, timeout,
app_1 | File "/usr/local/lib/python3.9/smtplib.py", line 255, in init
app_1 | (code, msg) = self.connect(host, port)
app_1 | File "/usr/local/lib/python3.9/smtplib.py", line 341, in connect
app_1 | self.sock = self._get_socket(host, port, self.timeout)
app_1 | File "/usr/local/lib/python3.9/smtplib.py", line 1057, in _get_socket
app_1 | new_socket = self.context.wrap_socket(new_socket,
app_1 | File "/usr/local/lib/python3.9/ssl.py", line 501, in wrap_socket
app_1 | return self.sslsocket_class._create(
app_1 | File "/usr/local/lib/python3.9/ssl.py", line 1041, in _create
app_1 | self.do_handshake()
app_1 | File "/usr/local/lib/python3.9/ssl.py", line 1310, in do_handshake
app_1 | self._sslobj.do_handshake()
app_1 | ssl.SSLError: [SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:1129)
app_1 |
app_1 | During handling of the above exception, another exception occurred:
app_1 |
app_1 | Traceback (most recent call last):
app_1 | File "/app/scanner.py", line 246, in
app_1 | main()
app_1 | File "/app/scanner.py", line 231, in main
app_1 | scanner = Scanner()
app_1 | File "/app/scanner.py", line 74, in init
app_1 | self.notifiers = Notifiers(self.config)
app_1 | File "/app/notifiers/init.py", line 15, in init
app_1 | self.smtp = SMTP(config)
app_1 | File "/app/notifiers/smtp.py", line 40, in init
app_1 | raise SMTPConfigurationError(exc.message) from exc
app_1 | AttributeError: 'ssl.SSLError' object has no attribute 'message'
tgtg_app_1 exited with code 1