TheWidlarzGroup / react-native-video

A <Video /> component for react-native
https://docs.thewidlarzgroup.com/react-native-video/
MIT License
7.21k stars 2.9k forks source link

How to handle the self signed https URL on iOS #2776

Open lh99998888 opened 2 years ago

lh99998888 commented 2 years ago

When I what to play a video asset stored in self signed certificate server via iOS, it shows error as "The certificate for this server is invalid.". Is there any way to ignore certificate validation? When request data from self signed cert server with NSURLSession, I can ignore cert validation using following code

- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable))completionHandler {
    NSURLCredential *credential = [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust];
    completionHandler(NSURLSessionAuthChallengeUseCredential, credential);
}

How can I do this in this component? as this issue #2649

emreer94 commented 3 months ago

Hi, did you managed to resolve this problem? @lh99998888