diff --git a/Downloader.m b/Downloader.m index 91ba9883..d270a849 100644 --- a/Downloader.m +++ b/Downloader.m @@ -134,6 +134,13 @@ - (void)URLSession:(NSURLSession *)session task:(NSURLSessionTask *)task didComp } } +#pragma 解决iOS端自定义 https证书 导致无法下载问题 +- (void)URLSession:(NSURLSession *)session didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge completionHandler:(void (^)(NSURLSessionAuthChallengeDisposition disposition, NSURLCredential *credential))completionHandler +{ + completionHandler(NSURLSessionAuthChallengeUseCredential, [NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust]); +} + + - (void)stopDownload { if (_task.state == NSURLSessionTaskStateRunning) { diff --git a/package-lock.json b/package-lock.json index dfb5ab9f..13422006 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "react-native-fs", - "version": "2.14.1", + "version": "2.14.2", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 4d636f08..d5c0d840 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-native-fs", - "version": "2.14.1", + "version": "2.14.2", "description": "Native filesystem access for react-native", "main": "FS.common.js", "typings": "index.d.ts",