Просмотр исходного кода

Merge branch 'master' of https://github.com/Psiphon-Labs/psiphon-tunnel-core

Rod Hynes 6 лет назад
Родитель
Сommit
d7d491e407

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

@@ -3,7 +3,7 @@ platform :ios, '10.0'
 target 'TunneledWebRequest' do
 target 'TunneledWebRequest' do
     pod 'OpenSSL-Universal', '1.0.2.17'
     pod 'OpenSSL-Universal', '1.0.2.17'
     pod 'PsiphonTunnel', :git => 'https://github.com/Psiphon-Labs/psiphon-tunnel-core-iOS-library.git'
     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 => 'b945a57'
+    pod 'OCSPCache', :git => "https://github.com/Psiphon-Labs/OCSPCache.git", :commit => '71e9f5d'
     #pod 'OCSPCache', :path => "../../../../../OCSPCache/"
     #pod 'OCSPCache', :path => "../../../../../OCSPCache/"
 end
 end
 
 

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

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

+ 6 - 2
MobileLibrary/iOS/SampleApps/TunneledWebRequest/TunneledWebRequest.xcodeproj/project.pbxproj

@@ -182,7 +182,7 @@
 				662658E81DCB8CF300872F6C /* Resources */,
 				662658E81DCB8CF300872F6C /* Resources */,
 				662659221DCBC8CB00872F6C /* CopyFiles */,
 				662659221DCBC8CB00872F6C /* CopyFiles */,
 				161BCAA9D00D77704E622F78 /* [CP] Embed Pods Frameworks */,
 				161BCAA9D00D77704E622F78 /* [CP] Embed Pods Frameworks */,
-				A679CFEFFDF17884E46F6A14 /* [CP] Copy Pods Resources */,
+				E95FF7FB68DCD903DA655AE2 /* [CP] Copy Pods Resources */,
 			);
 			);
 			buildRules = (
 			buildRules = (
 			);
 			);
@@ -346,14 +346,18 @@
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
 			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
 			showEnvVarsInLog = 0;
 			showEnvVarsInLog = 0;
 		};
 		};
-		A679CFEFFDF17884E46F6A14 /* [CP] Copy Pods Resources */ = {
+		E95FF7FB68DCD903DA655AE2 /* [CP] Copy Pods Resources */ = {
 			isa = PBXShellScriptBuildPhase;
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
 			);
 			);
+			inputFileListPaths = (
+			);
 			inputPaths = (
 			inputPaths = (
 			);
 			);
 			name = "[CP] Copy Pods Resources";
 			name = "[CP] Copy Pods Resources";
+			outputFileListPaths = (
+			);
 			outputPaths = (
 			outputPaths = (
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;

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

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

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

@@ -3,7 +3,7 @@ platform :ios, '10.0'
 target 'TunneledWebView' do
 target 'TunneledWebView' do
     pod 'OpenSSL-Universal', '1.0.2.17'
     pod 'OpenSSL-Universal', '1.0.2.17'
     pod 'PsiphonTunnel', :git => 'https://github.com/Psiphon-Labs/psiphon-tunnel-core-iOS-library.git'
     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 => 'b945a57'
+    pod 'OCSPCache', :git => "https://github.com/Psiphon-Labs/OCSPCache.git", :commit => '71e9f5d'
     #pod 'OCSPCache', :path => "../../../../../OCSPCache/"
     #pod 'OCSPCache', :path => "../../../../../OCSPCache/"
 end
 end
 
 

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

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

+ 14 - 10
MobileLibrary/iOS/SampleApps/TunneledWebView/TunneledWebView.xcodeproj/project.pbxproj

@@ -214,7 +214,7 @@
 				662658E81DCB8CF300872F6C /* Resources */,
 				662658E81DCB8CF300872F6C /* Resources */,
 				662659221DCBC8CB00872F6C /* CopyFiles */,
 				662659221DCBC8CB00872F6C /* CopyFiles */,
 				055465DE48CF8066AB340776 /* [CP] Embed Pods Frameworks */,
 				055465DE48CF8066AB340776 /* [CP] Embed Pods Frameworks */,
-				8A8D8BC5E8DAB19D43A5010A /* [CP] Copy Pods Resources */,
+				38F1196294383441FD177AFA /* [CP] Copy Pods Resources */,
 			);
 			);
 			buildRules = (
 			buildRules = (
 			);
 			);
@@ -360,37 +360,41 @@
 			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TunneledWebView/Pods-TunneledWebView-frameworks.sh\"\n";
 			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TunneledWebView/Pods-TunneledWebView-frameworks.sh\"\n";
 			showEnvVarsInLog = 0;
 			showEnvVarsInLog = 0;
 		};
 		};
-		5D5B0B0744787E007145BB7C /* [CP] Check Pods Manifest.lock */ = {
+		38F1196294383441FD177AFA /* [CP] Copy Pods Resources */ = {
 			isa = PBXShellScriptBuildPhase;
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
 			);
 			);
+			inputFileListPaths = (
+			);
 			inputPaths = (
 			inputPaths = (
-				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
-				"${PODS_ROOT}/Manifest.lock",
 			);
 			);
-			name = "[CP] Check Pods Manifest.lock";
+			name = "[CP] Copy Pods Resources";
+			outputFileListPaths = (
+			);
 			outputPaths = (
 			outputPaths = (
-				"$(DERIVED_FILE_DIR)/Pods-TunneledWebView-checkManifestLockResult.txt",
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellPath = /bin/sh;
-			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
+			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TunneledWebView/Pods-TunneledWebView-resources.sh\"\n";
 			showEnvVarsInLog = 0;
 			showEnvVarsInLog = 0;
 		};
 		};
-		8A8D8BC5E8DAB19D43A5010A /* [CP] Copy Pods Resources */ = {
+		5D5B0B0744787E007145BB7C /* [CP] Check Pods Manifest.lock */ = {
 			isa = PBXShellScriptBuildPhase;
 			isa = PBXShellScriptBuildPhase;
 			buildActionMask = 2147483647;
 			buildActionMask = 2147483647;
 			files = (
 			files = (
 			);
 			);
 			inputPaths = (
 			inputPaths = (
+				"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
+				"${PODS_ROOT}/Manifest.lock",
 			);
 			);
-			name = "[CP] Copy Pods Resources";
+			name = "[CP] Check Pods Manifest.lock";
 			outputPaths = (
 			outputPaths = (
+				"$(DERIVED_FILE_DIR)/Pods-TunneledWebView-checkManifestLockResult.txt",
 			);
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 			runOnlyForDeploymentPostprocessing = 0;
 			shellPath = /bin/sh;
 			shellPath = /bin/sh;
-			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-TunneledWebView/Pods-TunneledWebView-resources.sh\"\n";
+			shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
 			showEnvVarsInLog = 0;
 			showEnvVarsInLog = 0;
 		};
 		};
 /* End PBXShellScriptBuildPhase section */
 /* End PBXShellScriptBuildPhase section */

+ 13 - 11
MobileLibrary/iOS/SampleApps/TunneledWebView/TunneledWebView/AppDelegate.swift

@@ -29,17 +29,19 @@ import PsiphonTunnel
     @objc public lazy var authURLSessionDelegate: OCSPAuthURLSessionDelegate =
     @objc public lazy var authURLSessionDelegate: OCSPAuthURLSessionDelegate =
         OCSPAuthURLSessionDelegate.init(logger: {print("[AuthURLSessionTaskDelegate]:", $0)},
         OCSPAuthURLSessionDelegate.init(logger: {print("[AuthURLSessionTaskDelegate]:", $0)},
                                         ocspCache: self.ocspCache,
                                         ocspCache: self.ocspCache,
-                                        modifyOCSPURL:{
-                                            assert(self.httpProxyPort > 0)
-
-                                            let encodedTargetURL = URLEncode.encode($0.absoluteString)
-                                            let proxiedURLString = "http://127.0.0.1:\(self.httpProxyPort)/tunneled/\(encodedTargetURL!)"
-                                            let proxiedURL = URL.init(string: proxiedURLString)
-
-                                            print("[OCSP] Updated OCSP URL \($0) to \(proxiedURL!)")
-
-                                            return proxiedURL!},
-                                        session:nil)
+                                        // Unlike TunneledWebRequest we do not need to manually
+                                        // update the OCSP request to be proxied through the local
+                                        // HTTP proxy. Since JAHPAuthenticatingHTTPProtocol
+                                        // subclasses and registers itself with NSURLProtocol, all
+                                        // URL requests made manually (using the foundation
+                                        // framework) will be proxied automatically.
+                                        //
+                                        // Since the OCSPCache library makes requests using
+                                        // NSURLSessionDataTask, the OCSP requests will be proxied
+                                        // automatically.
+                                        modifyOCSPURL:nil,
+                                        session:nil,
+                                        timeout:10)
     
     
     @objc public class func sharedDelegate() -> AppDelegate {
     @objc public class func sharedDelegate() -> AppDelegate {
         var delegate: AppDelegate?
         var delegate: AppDelegate?