Skip to content
This repository was archived by the owner on Oct 30, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions Libraries/Network/RCTHTTPRequestHandler.mm
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ -(void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticati
NSString *host = challenge.protectionSpace.host;

// Read the clientSSL info from MMKV
__block NSDictionary *clientSSL;
__block NSString *clientSSL;
SecureStorage *secureStorage = [[SecureStorage alloc] init];

// https://github.com/ammarahm-ed/react-native-mmkv-storage/blob/master/src/loader.js#L31
Expand All @@ -141,13 +141,15 @@ -(void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticati

NSData *cryptKey = [key dataUsingEncoding:NSUTF8StringEncoding];
MMKV *mmkv = [MMKV mmkvWithID:@"default" cryptKey:cryptKey mode:MMKVMultiProcess];
clientSSL = [mmkv getObjectOfClass:[NSDictionary class] forKey:host];
clientSSL = [mmkv getStringForKey:host];
NSData *data = [clientSSL dataUsingEncoding:NSUTF8StringEncoding];
id dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];

NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];

if (clientSSL != (id)[NSNull null]) {
NSString *path = [clientSSL objectForKey:@"path"];
NSString *password = [clientSSL objectForKey:@"password"];
if (dict != (id)[NSNull null]) {
NSString *path = [dict objectForKey:@"path"];
NSString *password = [dict objectForKey:@"password"];
credential = [self getUrlCredential:challenge path:path password:password];
}

Expand Down
12 changes: 7 additions & 5 deletions Libraries/WebSocket/RCTSRWebSocket.m
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ - (void)_initializeStreams
#endif

// Read the clientSSL info from MMKV
__block NSDictionary *clientSSL;
__block NSString *clientSSL;
SecureStorage *secureStorage = [[SecureStorage alloc] init];

// https://github.com/ammarahm-ed/react-native-mmkv-storage/blob/master/src/loader.js#L31
Expand All @@ -563,11 +563,13 @@ - (void)_initializeStreams

NSData *cryptKey = [key dataUsingEncoding:NSUTF8StringEncoding];
MMKV *mmkv = [MMKV mmkvWithID:@"default" cryptKey:cryptKey mode:MMKVMultiProcess];
clientSSL = [mmkv getObjectOfClass:[NSDictionary class] forKey:host];
clientSSL = [mmkv getStringForKey:host];
NSData *data = [clientSSL dataUsingEncoding:NSUTF8StringEncoding];
id dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil];

if (clientSSL != (id)[NSNull null]) {
NSString *path = [clientSSL objectForKey:@"path"];
NSString *password = [clientSSL objectForKey:@"password"];
if (dict != (id)[NSNull null]) {
NSString *path = [dict objectForKey:@"path"];
NSString *password = [dict objectForKey:@"password"];

[self setClientSSL:path password:password options:SSLOptions];
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native",
"version": "0.64.2",
"version": "0.64.2-rocket",
"bin": "./cli.js",
"description": "A framework for building native apps using React",
"license": "MIT",
Expand Down