Repository navigation
Conversation
Websocket now verifies SSL with the same CA bundle as 'requests', skips IPv6 addresses when python has no IPv6 support, and the event hub logs the first connection failure. Ported from ynput/ayon-core#2241 and ynput/ayon-core#2243. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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.
Changelog Description
Websocket connections to the AYON server now work in pythons that have no system CA certificates or no IPv6 support. Flame on macOS hits both. Before this change, REST requests worked there but the websocket connection always failed.
Additional info
Ports the client changes from ynput/ayon-core#2241 and ynput/ayon-core#2243 into
ServerAPI.create_websocketandEventHub.create_websocketnow passes therequestsCA bundle to websocket. It checksREQUESTS_CA_BUNDLE, thenCURL_CA_BUNDLE, then falls back to certifi. A directory is passed asca_cert_path. Before,websocket-clientfell back to thessldefault certificates, and a python.org build on macOS has none, so everywss://connection failed withCERTIFICATE_VERIFY_FAILED.socket.has_ipv6isFalse, IPv6 addresses are filtered out of websocket's address resolution. This wraps the privatewebsocket._http._get_addrinfo_listand is applied only once. Before,localhostresolved to::1first and websocket failed withconnect(): bad familyinstead of trying IPv4.EventHublogs the first websocket connection failure as a warning, including the exception. Before, every exception in the loop was swallowed silently.Testing notes:
https://...andhttp://localhost:<port>.EventHub(or open AYON tools) and check that the websocket connects (connection.openedis emitted).