Przeglądaj źródła

Update OCSPCache for NSURLSession reuse

- OCSPCache/c11ab4a now offers NSURLSession
  reuse when making OCSP requests
- Add NSURLSession reuse in TunneledWebView
mirokuratczyk 6 lat temu
rodzic
commit
fad5fd1a92

+ 1 - 1
MobileLibrary/iOS/SampleApps/TunneledWebRequest/Podfile

@@ -3,7 +3,7 @@ platform :ios, '10.0'
 target 'TunneledWebRequest' do
     pod 'OpenSSL-Universal', '1.0.2.17'
     pod 'PsiphonTunnel', :git => 'https://github.com/Psiphon-Labs/psiphon-tunnel-core-iOS-library.git'
-    pod 'OCSPCache', :git => "https://github.com/Psiphon-Labs/OCSPCache.git", :commit => '9d7820e'
+    pod 'OCSPCache', :git => "https://github.com/Psiphon-Labs/OCSPCache.git", :commit => 'c11ab4a'
     #pod 'OCSPCache', :path => "../../../../../OCSPCache/"
 end
 

+ 4 - 4
MobileLibrary/iOS/SampleApps/TunneledWebRequest/Podfile.lock

@@ -7,20 +7,20 @@ PODS:
   - ReactiveObjC (3.1.1)
 
 DEPENDENCIES:
-  - OCSPCache (from `https://github.com/Psiphon-Labs/OCSPCache.git`, commit `9d7820e`)
+  - OCSPCache (from `https://github.com/Psiphon-Labs/OCSPCache.git`, commit `c11ab4a`)
   - OpenSSL-Universal (= 1.0.2.17)
   - PsiphonTunnel (from `https://github.com/Psiphon-Labs/psiphon-tunnel-core-iOS-library.git`)
 
 EXTERNAL SOURCES:
   OCSPCache:
-    :commit: 9d7820e
+    :commit: c11ab4a
     :git: https://github.com/Psiphon-Labs/OCSPCache.git
   PsiphonTunnel:
     :git: https://github.com/Psiphon-Labs/psiphon-tunnel-core-iOS-library.git
 
 CHECKOUT OPTIONS:
   OCSPCache:
-    :commit: 9d7820e
+    :commit: c11ab4a
     :git: https://github.com/Psiphon-Labs/OCSPCache.git
   PsiphonTunnel:
     :commit: c9af3bab93637163e117de9d1e77435baa7646c0
@@ -32,6 +32,6 @@ SPEC CHECKSUMS:
   PsiphonTunnel: 0c3f8677e4b26316beba57df78ed9c75634ce091
   ReactiveObjC: 011caa393aa0383245f2dcf9bf02e86b80b36040
 
-PODFILE CHECKSUM: e2f36d288d3199ef090bf05356b5f9b08ed0671b
+PODFILE CHECKSUM: 5d14326a7bc6321dd36c896716017ca18e9280be
 
 COCOAPODS: 1.4.0

+ 1 - 1
MobileLibrary/iOS/SampleApps/TunneledWebRequest/TunneledWebRequest/AppDelegate.swift

@@ -40,7 +40,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
 
                                             return proxiedURL!
                                         },
-                                        sessionConfig:nil)
+                                        session:URLSession.shared)
 
     @objc public class func sharedDelegate() -> AppDelegate {
         var delegate: AppDelegate?

+ 13 - 4
MobileLibrary/iOS/SampleApps/TunneledWebView/External/JiveAuthenticatingHTTPProtocol/JAHPAuthenticatingHTTPProtocol.m

@@ -797,10 +797,19 @@ didReceiveChallenge:(NSURLAuthenticationChallenge *)challenge
         // Makes OCSP requests through local HTTP proxy.
         OCSPAuthURLSessionDelegate *authHandler = [[AppDelegate sharedDelegate] authURLSessionDelegate];
 
-        [authHandler URLSession:session
-                                task:task
-                 didReceiveChallenge:challenge
-                   completionHandler:completionHandler];
+        assert(challenge.protectionSpace.serverTrust != nil);
+
+        BOOL evaluateSuccess =
+        [authHandler evaluateTrust:challenge.protectionSpace.serverTrust
+             modifyOCSPURLOverride:nil
+                   sessionOverride:sharedDemuxInstance.session
+                 completionHandler:completionHandler];
+
+        [[self class] authenticatingHTTPProtocol:self
+                                   logWithFormat:@"Evaluate trust for %@ %@",
+                                                 challenge.protectionSpace.host,
+                                                 evaluateSuccess ? @"succeeded": @"failed"];
+
         return;
     }
 

+ 1 - 1
MobileLibrary/iOS/SampleApps/TunneledWebView/Podfile

@@ -3,7 +3,7 @@ platform :ios, '10.0'
 target 'TunneledWebView' do
     pod 'OpenSSL-Universal', '1.0.2.17'
     pod 'PsiphonTunnel', :git => 'https://github.com/Psiphon-Labs/psiphon-tunnel-core-iOS-library.git'
-    pod 'OCSPCache', :git => "https://github.com/Psiphon-Labs/OCSPCache.git", :commit => '9d7820e'
+    pod 'OCSPCache', :git => "https://github.com/Psiphon-Labs/OCSPCache.git", :commit => 'c11ab4a'
     #pod 'OCSPCache', :path => "../../../../../OCSPCache/"
 end
 

+ 4 - 4
MobileLibrary/iOS/SampleApps/TunneledWebView/Podfile.lock

@@ -7,20 +7,20 @@ PODS:
   - ReactiveObjC (3.1.1)
 
 DEPENDENCIES:
-  - OCSPCache (from `https://github.com/Psiphon-Labs/OCSPCache.git`, commit `9d7820e`)
+  - OCSPCache (from `https://github.com/Psiphon-Labs/OCSPCache.git`, commit `c11ab4a`)
   - OpenSSL-Universal (= 1.0.2.17)
   - PsiphonTunnel (from `https://github.com/Psiphon-Labs/psiphon-tunnel-core-iOS-library.git`)
 
 EXTERNAL SOURCES:
   OCSPCache:
-    :commit: 9d7820e
+    :commit: c11ab4a
     :git: https://github.com/Psiphon-Labs/OCSPCache.git
   PsiphonTunnel:
     :git: https://github.com/Psiphon-Labs/psiphon-tunnel-core-iOS-library.git
 
 CHECKOUT OPTIONS:
   OCSPCache:
-    :commit: 9d7820e
+    :commit: c11ab4a
     :git: https://github.com/Psiphon-Labs/OCSPCache.git
   PsiphonTunnel:
     :commit: c9af3bab93637163e117de9d1e77435baa7646c0
@@ -32,6 +32,6 @@ SPEC CHECKSUMS:
   PsiphonTunnel: 0c3f8677e4b26316beba57df78ed9c75634ce091
   ReactiveObjC: 011caa393aa0383245f2dcf9bf02e86b80b36040
 
-PODFILE CHECKSUM: 4abc8555e10ac6f8a1ae5ad3eacff557c0c5b0fa
+PODFILE CHECKSUM: 629c0670c2f7481c4a8961b6c16998ecdee766ab
 
 COCOAPODS: 1.4.0

+ 1 - 1
MobileLibrary/iOS/SampleApps/TunneledWebView/TunneledWebView/AppDelegate.swift

@@ -39,7 +39,7 @@ import PsiphonTunnel
                                             print("[OCSP] Updated OCSP URL \($0) to \(proxiedURL!)")
 
                                             return proxiedURL!},
-                                        sessionConfig:nil)
+                                        session:nil)
     
     @objc public class func sharedDelegate() -> AppDelegate {
         var delegate: AppDelegate?