Add SocketRocket Security Policy Provider #44396
Closed
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.
Summary:
When you have a server that is under a Client Certificate logic, and has some connection to it using websockets, you can't provide the security policy to the instance created for the socket on
RCTWebSocketModule
.Following what we have for
RCTNetworking
where you can inject a custom configuration for theURLSession
created, these changes aim to implement a similar way to provide a custom handler for creating a Socket Rocket SecurityPolicy based on the request that will be sent through the socket.Changelog:
[IOS] [CHANGED] - Add SocketRocket Security Policy Provider
Test Plan:
I can't provide my own server with the client certificate here, but the important piece of code is above, this is a customization that is important to react-native developers, for Android we already have a way to customize the OkHttp instance being used by the socket, that I proposed some time ago, so this new api will make it easier for developers to inject custom websocket security policies for iOS too, since they will not need to do any method swizzling or fork of react-native.