Skip to content

Conversation

@majiayu000
Copy link

Summary

  • Add --insecure option to the CLI that allows connecting to wss:// endpoints with self-signed or invalid SSL certificates
  • This is useful for testing and development purposes when using custom certificates

Changes

  • Modified src/websockets/cli.py to add --insecure argument
  • When --insecure is specified, the CLI creates an SSL context that disables certificate verification and hostname checking
  • Added tests for the new functionality

Test plan

  • Added test test_insecure_connection - verifies connection works with --insecure flag
  • Added test test_insecure_connection_fails_without_flag - verifies connection fails without the flag when using self-signed cert
  • All existing tests pass

Fixes #1675

Add an --insecure option to the CLI that allows connecting to
wss:// endpoints with self-signed or invalid SSL certificates.
This is useful for testing and development purposes.

When --insecure is specified, the CLI creates an SSL context that
disables certificate verification and hostname checking.

Fixes python-websockets#1675
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow CLI to connect to custom "insecure" wss endpoints

1 participant