You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm trying to set up an Aiosmtpd server to accept TLS1.1 too, and I can't make it work. Regardless of how I configure TLSContext, the server only accepts TLS1.2.
Here's a reproducible code to show the issue:
# Server:fromaiosmtpd.controllerimportControllerfromaiosmtpd.smtpimportSMTPfromaiosmtpd.handlersimportDebuggingimportssl, certifi, signalclassCustomController(Controller):
deffactory(self):
context=ssl.create_default_context(ssl.Purpose.CLIENT_AUTH, cafile=certifi.where())
context.set_ciphers('HIGH:MEDIUM:!LOW:!DHE')
context.set_ecdh_curve("secp384r1")
context.options|=ssl.OP_NO_SSLv2context.options|=ssl.OP_NO_SSLv3context.options|=ssl.PROTOCOL_TLSv1context.options|=ssl.PROTOCOL_TLSv1_1context.options|=ssl.PROTOCOL_TLSv1_2context.options|=ssl.PROTOCOL_TLSv1_3context.minimum_version=ssl.TLSVersion.TLSv1context.maximum_version=ssl.TLSVersion.TLSv1_3base_path='/etc/letsencrypt/live/smtp.server.com'context.load_cert_chain(
'{}/fullchain.pem'.format(base_path),
'{}/privkey.pem'.format(base_path)
) # via Let's EncryptreturnSMTP(
handler=self.handler,
ident="Welcome.",
tls_context=context,
)
if__name__=='__main__':
controller=CustomController(Debugging(), hostname="localhost", port=2525)
# Run the event loop in a separate thread.controller.start()
print("Daemong started. Waiting for SIGINT or SIGQUIT to quit.")
sig=signal.sigwait([signal.SIGINT, signal.SIGQUIT])
print("Quitting SMTP Daemon")
controller.stop()
The above configured context should accept TLSv1 up to TLSv1_3.
Now, here's a client, that only have TLS1.1 enabled:
[SSL: NO_PROTOCOLS_AVAILABLE] no protocols available (_ssl.c:1000)
Traceback (most recent call last):
File "/home/user/st.py", line 23, in <module>
print(smtp.starttls(context=context))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/smtplib.py", line 779, in starttls
self.sock = context.wrap_socket(self.sock,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/ssl.py", line 455, in wrap_socket
return self.sslsocket_class._create(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib64/python3.12/ssl.py", line 1042, in _create
self.do_handshake()
File "/usr/lib64/python3.12/ssl.py", line 1320, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: NO_PROTOCOLS_AVAILABLE] no protocols available (_ssl.c:1000)
=> NO_PROTOCOLS_AVAILABLE
Why is that? Am I missing something? An option to enable to allow more than TLS1.2 ?
The text was updated successfully, but these errors were encountered:
Hi!
I'm trying to set up an Aiosmtpd server to accept TLS1.1 too, and I can't make it work. Regardless of how I configure TLSContext, the server only accepts TLS1.2.
Here's a reproducible code to show the issue:
The above configured context should accept TLSv1 up to TLSv1_3.
Now, here's a client, that only have TLS1.1 enabled:
The exchange fails with the following SSL error:
=> NO_PROTOCOLS_AVAILABLE
Why is that? Am I missing something? An option to enable to allow more than TLS1.2 ?
The text was updated successfully, but these errors were encountered: