From a3a59e1a8522a6b84e15ac0827dbf13565637ae1 Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Wed, 12 Jul 2023 10:51:36 -0300 Subject: [PATCH] Fix Reactotron socket --- ios/RCTHTTPRequestHandler+Challenge.mm | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/ios/RCTHTTPRequestHandler+Challenge.mm b/ios/RCTHTTPRequestHandler+Challenge.mm index 8ec7d0639..5af9ccdab 100644 --- a/ios/RCTHTTPRequestHandler+Challenge.mm +++ b/ios/RCTHTTPRequestHandler+Challenge.mm @@ -186,16 +186,17 @@ clientSSL = [mmkv getStringForKey:_urlRequest.URL.host]; if (clientSSL) { - NSData *data = [clientSSL dataUsingEncoding:NSUTF8StringEncoding]; - id dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; - NSString *path = [dict objectForKey:@"path"]; - NSString *password = [dict objectForKey:@"password"]; - [self setClientSSL:path password:password options:SSLOptions]; + NSData *data = [clientSSL dataUsingEncoding:NSUTF8StringEncoding]; + id dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:nil]; + NSString *path = [dict objectForKey:@"path"]; + NSString *password = [dict objectForKey:@"password"]; + [self setClientSSL:path password:password options:SSLOptions]; + if (SSLOptions) { + id _outputStream = [self valueForKey:@"_outputStream"]; + [_outputStream setProperty:SSLOptions forKey:(__bridge id)kCFStreamPropertySSLSettings]; + } } } - - id _outputStream = [self valueForKey:@"_outputStream"]; - [_outputStream setProperty:SSLOptions forKey:(__bridge id)kCFStreamPropertySSLSettings]; } @end