Repository navigation
Use the wss scheme for WebSocket connections over TLS - #215
Merged
Merged
Conversation
WebSocketConnection built a ws:// URI whatever ssl was, and websockets refuses
an ssl argument on a ws:// URI ("ssl argument is incompatible with a ws://
URI"), so a connection with ssl set could never be made. RFC 6455 names
WebSocket over TLS wss://; the scheme now follows ssl.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #212.
Summary
WebSocketConnection.connectbuiltws://{host}:{port}/{path}whateversslwas, and websockets refuses ansslargument on aws://URI, so a connection over TLS could not be made.ssl:wsswhen it is set, the scheme RFC 6455, section 3 defines for WebSocket over TLS, andwsotherwise.Validation
just lintjust check-typesjust test-fast: 447 passed.test_connection_uri_scheme_follows_sslchecks the URI handed towebsockets.connectforssl=Noneandssl=True, and fails without the change.just test(integration) not run.Note
test_connection_ws.pyis skipped unless the rootwsdependency group is installed (uv sync --all-groups).just install, which every CI job runs, installs extras only, so CI currently skips the WebSocket tests, this one included. Happy to open a separate PR adding the group tojust install.