Closed phoenixbox closed 8 years ago
Thanks for the issue...
What version of RN are you using and how old is your RN app (issue I linked below looks like it had issues with older versions of RN)?
My app's NSAppTransportSecurity
key in my info.plist
file is empty.
<key>NSAppTransportSecurity</key>
I did see this issue on a quick google search, looks like some other people have some solutions for something similar.
If you find a fix, can you post what worked for you on this thread for anyone else who might encounter it?
@benjreinhart Hey 👋 there, Im on react-native 0.29
so I tried again, when NSAppTransportSecurity
is empty then the Simulator cant connect to localhost so I added the selected fix to the info.plist
which is
<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>localhost</key>
<dict>
<key>NSTemporaryExceptionAllowsInsecureHTTPSLoads</key>
<false/>
<key>NSIncludesSubdomains</key>
<true/>
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>1.0</string>
<key>NSTemporaryExceptionRequiresForwardSecrecy</key>
<false/>
</dict>
</dict>
</dict>
When using that and the sample code, the error persists:
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
Not sure whats going on 😟
Do you happen to have a public repo RN app which uses your lib that you could share? I could clone and see if I can get to work on my local machine?
@benjreinhart so I fixed the issued I was experiencing.
This error:
NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9802)
Was due to an untrusted local react-native server development certificate:
The certificate for this server is invalid. You might be connecting to a server that is pretending to be “${YOUR_BUCKET_NAME}.s3.amazonaws.com” which could put your confidential information at risk.
To which there is an advised:
@phoenixbox very nice, thank you for the detailed follow up!
@phoenixbox Did you try the production source fix? Any idea how to get react-native calling S3, to work on IOS simulator? Im having a hard time understanding the stackoverflow post.
Hey @jomaint, try updating the RCTHTTPRequestHandler.m
with the snippet below. I modified how the request challenge is handled by making the change at line:85 #pragma mark - NSURLSession delegate
of RCTHTTPRequestHandler.m
.
- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler
{
completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]);
}
As for using a real certificate for development, I can't say I know how to make that work. I just used this workaround for local development. Removed it for production builds on devices, and it works
@phoenixbox Thanks for your response! I’ll give a go and see how it goes
Hey there,
Im getting a networking error when trying to upload to S3 from my
react-native
app running on my device.Error
From Googling around there are suggestions to add the AWS domains to the
NSExceptionDomains
in theinfo.plist
. Ive tried the followingxml
in theplist
but am still experiencing the same issue.What
NSAppTransportSecurity
do you use for uploading to S3?