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
{{ message }}
Repository navigation
StreamWriter.start_tls should allow overriding server_side #155896
start_tls() is used to upgrade a connection to a secure version.
Currently the server_side parameter is calculated based on the existence of a callback which is only set by start_server().
While for most cases the server should be performing the server role for the TLS handshake, there's a few instances the opposite is desired.
For my personal use case I've duplicated the logic and added a new kwarg to set it manually and it works.
Has this already been discussed elsewhere?
This is a minor feature, which does not need previous discussion elsewhere
I'm not sure that we should go in this direction.
From my perspective, server_side=True is mandatory for server mode.
Otherwise, we open an attack vector for Python users.
If the risk is tolerable for you, duplicated logic is fine IMHO.
Activity
asvetlov commentedon Nov 2, 2026
I'm not sure that we should go in this direction.
From my perspective,
server_side=Trueis mandatory for server mode.Otherwise, we open an attack vector for Python users.
If the risk is tolerable for you, duplicated logic is fine IMHO.
krystalgamer commentedon Nov 2, 2026
it's a niche usecase with server-to-server communication. totally fine with duplicating the logic :)
@asvetlov i'm not following the attack vector you mention.
pythongh-155896: Allow overriding TLS roles in StreamWriter.start_tls