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

Fix to SSL issues on clients connecting with older TLS servers #39

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Fixed

* Context information `tos` in the Postmaster email handling
* Critical issue with the SMTP client when connecting with SMTP servers with older versions of OpenSSL

## [1.19.2] - 2024-01-17

Expand Down
6 changes: 3 additions & 3 deletions src/netius/base/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -3669,7 +3669,7 @@ def _ssl_ctx_base(self, context, secure = 1, context_options = []):
for context_option in context_options:
if not hasattr(ssl, context_option): continue
context.options |= getattr(ssl, context_option)
if secure and hasattr(context, "set_ecdh_curve"):
if secure >= 2 and hasattr(context, "set_ecdh_curve"):
context.set_ecdh_curve("prime256v1")
if secure >= 1 and SSL_DH_PATH and hasattr(context, "load_dh_params"):
context.load_dh_params(SSL_DH_PATH)
Expand All @@ -3683,14 +3683,14 @@ def _ssl_ctx_alpn(self, context):
if not ssl.HAS_ALPN: return
if hasattr(context, "set_alpn_protocols"):
protocols = self.get_protocols()
protocols and context.set_alpn_protocols(protocols)
if protocols: context.set_alpn_protocols(protocols)

def _ssl_ctx_npn(self, context):
if not hasattr(ssl, "HAS_NPN"): return
if not ssl.HAS_NPN: return
if hasattr(context, "set_npn_protocols"):
protocols = self.get_protocols()
protocols and context.set_npn_protocols(protocols)
if protocols: context.set_npn_protocols(protocols)

def _ssl_certs(
self,
Expand Down