Add SPI for allowing HTTPS certificates
authorandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Feb 2014 22:58:29 +0000 (22:58 +0000)
committerandersca@apple.com <andersca@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Feb 2014 22:58:29 +0000 (22:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=129002

Reviewed by Dan Bernstein.

* UIProcess/API/Cocoa/WKProcessClass.mm:
(-[WKProcessClass _setAllowsSpecificHTTPSCertificate:forHost:]):
* UIProcess/API/Cocoa/WKProcessClassInternal.h:
* UIProcess/API/Cocoa/WKProcessClassPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassInternal.h.
* WebKit2.xcodeproj/project.pbxproj:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164325 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKProcessClass.mm
Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassInternal.h
Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassPrivate.h [new file with mode: 0644]
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj

index dc28d6e..3ef4872 100644 (file)
@@ -1,5 +1,18 @@
 2014-02-18  Anders Carlsson  <andersca@apple.com>
 
+        Add SPI for allowing HTTPS certificates
+        https://bugs.webkit.org/show_bug.cgi?id=129002
+
+        Reviewed by Dan Bernstein.
+
+        * UIProcess/API/Cocoa/WKProcessClass.mm:
+        (-[WKProcessClass _setAllowsSpecificHTTPSCertificate:forHost:]):
+        * UIProcess/API/Cocoa/WKProcessClassInternal.h:
+        * UIProcess/API/Cocoa/WKProcessClassPrivate.h: Copied from Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassInternal.h.
+        * WebKit2.xcodeproj/project.pbxproj:
+
+2014-02-18  Anders Carlsson  <andersca@apple.com>
+
         Add SPI for getting the original URL from a WKNavigationAction
         https://bugs.webkit.org/show_bug.cgi?id=128997
 
index 4a12f1f..af0b27d 100644 (file)
@@ -31,7 +31,9 @@
 #import "HistoryClient.h"
 #import "WKObject.h"
 #import "WKProcessClassConfigurationPrivate.h"
+#import "WebCertificateInfo.h"
 #import "WebContext.h"
+#import <WebCore/CertificateInfo.h>
 #import <wtf/RetainPtr.h>
 
 #if PLATFORM(IOS)
 
 @end
 
+@implementation WKProcessClass (WKPrivate)
+
+- (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host
+{
+    _context->allowSpecificHTTPSCertificateForHost(WebKit::WebCertificateInfo::create(WebCore::CertificateInfo((CFArrayRef)certificateChain)).get(), host);
+}
+
+@end
+
 #endif // WK_API_ENABLED
index a7079c6..a746992 100644 (file)
@@ -23,7 +23,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#import "WKProcessClass.h"
+#import "WKProcessClassPrivate.h"
 
 #if WK_API_ENABLED
 
diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassPrivate.h b/Source/WebKit2/UIProcess/API/Cocoa/WKProcessClassPrivate.h
new file mode 100644 (file)
index 0000000..bf12ac7
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2014 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import <WebKit2/WKProcessClass.h>
+
+#if WK_API_ENABLED
+
+@interface WKProcessClass (WKPrivate)
+
+- (void)_setAllowsSpecificHTTPSCertificate:(NSArray *)certificateChain forHost:(NSString *)host;
+
+@end
+
+#endif
index 2cbe543..393e750 100644 (file)
                1A64230912DD09EB00CAAE2C /* DrawingAreaProxyMessages.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A64230712DD09EB00CAAE2C /* DrawingAreaProxyMessages.h */; };
                1A64245E12DE29A100CAAE2C /* UpdateInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A64245C12DE29A100CAAE2C /* UpdateInfo.h */; };
                1A64245F12DE29A100CAAE2C /* UpdateInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */; };
+               1A6509CE18B4146200614332 /* WKProcessClassPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6509CD18B4146200614332 /* WKProcessClassPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
                1A6637D718B2831F00C0BCF3 /* APIHistoryClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6637D618B2831F00C0BCF3 /* APIHistoryClient.h */; };
                1A66BF8F18A052ED002071B4 /* WKWebViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */; };
                1A6F9F9011E13EFC00DB1371 /* CommandLine.h in Headers */ = {isa = PBXBuildFile; fileRef = 1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */; };
                1A64230712DD09EB00CAAE2C /* DrawingAreaProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DrawingAreaProxyMessages.h; sourceTree = "<group>"; };
                1A64245C12DE29A100CAAE2C /* UpdateInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = UpdateInfo.h; sourceTree = "<group>"; };
                1A64245D12DE29A100CAAE2C /* UpdateInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UpdateInfo.cpp; sourceTree = "<group>"; };
+               1A6509CD18B4146200614332 /* WKProcessClassPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKProcessClassPrivate.h; sourceTree = "<group>"; };
                1A6637D618B2831F00C0BCF3 /* APIHistoryClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIHistoryClient.h; sourceTree = "<group>"; };
                1A66BF8E18A052ED002071B4 /* WKWebViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKWebViewInternal.h; sourceTree = "<group>"; };
                1A6F9F8E11E13EFC00DB1371 /* CommandLine.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommandLine.h; sourceTree = "<group>"; };
                                1A3C887F18A5ABAE00C4C962 /* WKPreferencesInternal.h */,
                                1A158418189044F50017616C /* WKProcessClass.h */,
                                1A158417189044F50017616C /* WKProcessClass.mm */,
+                               1A6509CD18B4146200614332 /* WKProcessClassPrivate.h */,
                                1A43E828188F3CDC009E4D30 /* WKProcessClassConfiguration.h */,
                                1A43E827188F3CDC009E4D30 /* WKProcessClassConfiguration.mm */,
                                1A43E82B188F3CF5009E4D30 /* WKProcessClassConfigurationPrivate.h */,
                                512A9761180E031D0039A149 /* DatabaseProcessMessages.h in Headers */,
                                BC09B8F9147460F7005F5625 /* WebContextConnectionClient.h in Headers */,
                                BCDE059B11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h in Headers */,
+                               1A6509CE18B4146200614332 /* WKProcessClassPrivate.h in Headers */,
                                51871B5C127CB89D00F76232 /* WebContextMenu.h in Headers */,
                                BC032D7710F4378D0058C15A /* WebContextMenuClient.h in Headers */,
                                75E749EC180DBB9800088BA6 /* WebOriginDataManagerProxyMessages.h in Headers */,