├── _config.yml
├── img
├── PublicKeyPinning.png
└── CertificatePinning.png
├── SSLPinning
├── SSLPinning
│ ├── Assets.xcassets
│ │ ├── Contents.json
│ │ └── AppIcon.appiconset
│ │ │ └── Contents.json
│ ├── google.cer
│ ├── ViewController.swift
│ ├── AppDelegate.swift
│ ├── Base.lproj
│ │ ├── LaunchScreen.storyboard
│ │ └── Main.storyboard
│ ├── Info.plist
│ ├── SceneDelegate.swift
│ └── ServiceManager.swift
├── SSLPinning.xcodeproj
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcuserdata
│ │ │ └── Anuj.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ ├── xcuserdata
│ │ └── Anuj.xcuserdatad
│ │ │ ├── xcschemes
│ │ │ └── xcschememanagement.plist
│ │ │ └── xcdebugger
│ │ │ └── Breakpoints_v2.xcbkptlist
│ └── project.pbxproj
├── SSLPinningTests
│ ├── Info.plist
│ └── SSLPinningTests.swift
└── SSLPinningUITests
│ ├── Info.plist
│ └── SSLPinningUITests.swift
└── README.md
/_config.yml:
--------------------------------------------------------------------------------
1 | theme: jekyll-theme-cayman
--------------------------------------------------------------------------------
/img/PublicKeyPinning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujrai/SSLPinningDemoUsingURLSession/HEAD/img/PublicKeyPinning.png
--------------------------------------------------------------------------------
/img/CertificatePinning.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujrai/SSLPinningDemoUsingURLSession/HEAD/img/CertificatePinning.png
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/google.cer:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujrai/SSLPinningDemoUsingURLSession/HEAD/SSLPinning/SSLPinning/google.cer
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning.xcodeproj/project.xcworkspace/xcuserdata/Anuj.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/anujrai/SSLPinningDemoUsingURLSession/HEAD/SSLPinning/SSLPinning.xcodeproj/project.xcworkspace/xcuserdata/Anuj.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning.xcodeproj/xcuserdata/Anuj.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SSLPinning.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/ViewController.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.swift
3 | // SSLPinning
4 | //
5 | // Created by Anuj Rai on 25/01/20.
6 | // Copyright © 2020 Anuj Rai. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class ViewController: UIViewController {
12 |
13 | override func viewDidLoad() {
14 | super.viewDidLoad()
15 | guard let url = URL(string: "https://www.google.co.uk") else { return }
16 | ServiceManager().callAPI(withURL: url, isCertificatePinning: false) { (message) in
17 | let alert = UIAlertController(title: "SSLPinning", message: message, preferredStyle: .alert)
18 | alert.addAction(UIAlertAction(title: "OK", style: .default, handler: nil))
19 | self.present(alert, animated: true, completion: nil)
20 | }
21 | }
22 |
23 | }
24 |
25 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinningTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinningUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinningTests/SSLPinningTests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SSLPinningTests.swift
3 | // SSLPinningTests
4 | //
5 | // Created by Anuj Rai on 25/01/20.
6 | // Copyright © 2020 Anuj Rai. All rights reserved.
7 | //
8 |
9 | import XCTest
10 | @testable import SSLPinning
11 |
12 | class SSLPinningTests: XCTestCase {
13 |
14 | override func setUp() {
15 | // Put setup code here. This method is called before the invocation of each test method in the class.
16 | }
17 |
18 | override func tearDown() {
19 | // Put teardown code here. This method is called after the invocation of each test method in the class.
20 | }
21 |
22 | func testExample() {
23 | // This is an example of a functional test case.
24 | // Use XCTAssert and related functions to verify your tests produce the correct results.
25 | }
26 |
27 | func testPerformanceExample() {
28 | // This is an example of a performance test case.
29 | self.measure {
30 | // Put the code you want to measure the time of here.
31 | }
32 | }
33 |
34 | }
35 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 |
2 | # SSLPinning
3 |
4 | ## Table of contents
5 | * [General info](#general-info)
6 | * [Screenshots](#screenshots)
7 | * [Technologies](#technologies)
8 | * [Setup](#setup)
9 | * [Features](#features)
10 | * [Status](#status)
11 | * [Inspiration](#inspiration)
12 | * [Contact](#contact)
13 |
14 | ## General info
15 | This is iOS application which is basically created for ssl pinning using URLSession. In this both type of pinning is implemented (Certificate & Public Key)
16 |
17 | ## Screenshots
18 | 
19 | 
20 |
21 | ## Technologies
22 | * Platform iOS, iPad
23 | * IDE - Xcode11
24 | * Language - Swift 5.0
25 |
26 | ## Setup
27 | Ceckout the repository and open it in Xocde. Build and run in xcode.
28 |
29 | ## Features
30 | List of features ready
31 | * Certificate Pinning
32 | * Public key pinning
33 |
34 | ## Status
35 | Project is: Done
36 |
37 | ## Inspiration
38 | Done as a sample project.
39 |
40 | ## Contact
41 | Created by [@anujrai](anuj.rai2489@gmail.com) - feel free to contact me!
42 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/AppDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.swift
3 | // SSLPinning
4 | //
5 | // Created by Anuj Rai on 25/01/20.
6 | // Copyright © 2020 Anuj Rai. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | @UIApplicationMain
12 | class AppDelegate: UIResponder, UIApplicationDelegate {
13 |
14 |
15 |
16 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
17 | // Override point for customization after application launch.
18 | return true
19 | }
20 |
21 | // MARK: UISceneSession Lifecycle
22 |
23 | func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
24 | // Called when a new scene session is being created.
25 | // Use this method to select a configuration to create the new scene with.
26 | return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
27 | }
28 |
29 | func application(_ application: UIApplication, didDiscardSceneSessions sceneSessions: Set) {
30 | // Called when the user discards a scene session.
31 | // If any sessions were discarded while the application was not running, this will be called shortly after application:didFinishLaunchingWithOptions.
32 | // Use this method to release any resources that were specific to the discarded scenes, as they will not return.
33 | }
34 |
35 |
36 | }
37 |
38 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinningUITests/SSLPinningUITests.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SSLPinningUITests.swift
3 | // SSLPinningUITests
4 | //
5 | // Created by Anuj Rai on 25/01/20.
6 | // Copyright © 2020 Anuj Rai. All rights reserved.
7 | //
8 |
9 | import XCTest
10 |
11 | class SSLPinningUITests: XCTestCase {
12 |
13 | override func setUp() {
14 | // Put setup code here. This method is called before the invocation of each test method in the class.
15 |
16 | // In UI tests it is usually best to stop immediately when a failure occurs.
17 | continueAfterFailure = false
18 |
19 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
20 | }
21 |
22 | override func tearDown() {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | }
25 |
26 | func testExample() {
27 | // UI tests must launch the application that they test.
28 | let app = XCUIApplication()
29 | app.launch()
30 |
31 | // Use recording to get started writing UI tests.
32 | // Use XCTAssert and related functions to verify your tests produce the correct results.
33 | }
34 |
35 | func testLaunchPerformance() {
36 | if #available(macOS 10.15, iOS 13.0, tvOS 13.0, *) {
37 | // This measures how long it takes to launch your application.
38 | measure(metrics: [XCTOSSignpostMetric.applicationLaunch]) {
39 | XCUIApplication().launch()
40 | }
41 | }
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | $(PRODUCT_BUNDLE_PACKAGE_TYPE)
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UIApplicationSceneManifest
24 |
25 | UIApplicationSupportsMultipleScenes
26 |
27 | UISceneConfigurations
28 |
29 | UIWindowSceneSessionRoleApplication
30 |
31 |
32 | UISceneConfigurationName
33 | Default Configuration
34 | UISceneDelegateClassName
35 | $(PRODUCT_MODULE_NAME).SceneDelegate
36 | UISceneStoryboardFile
37 | Main
38 |
39 |
40 |
41 |
42 | UILaunchStoryboardName
43 | LaunchScreen
44 | UIMainStoryboardFile
45 | Main
46 | UIRequiredDeviceCapabilities
47 |
48 | armv7
49 |
50 | UISupportedInterfaceOrientations
51 |
52 | UIInterfaceOrientationPortrait
53 | UIInterfaceOrientationLandscapeLeft
54 | UIInterfaceOrientationLandscapeRight
55 |
56 | UISupportedInterfaceOrientations~ipad
57 |
58 | UIInterfaceOrientationPortrait
59 | UIInterfaceOrientationPortraitUpsideDown
60 | UIInterfaceOrientationLandscapeLeft
61 | UIInterfaceOrientationLandscapeRight
62 |
63 |
64 |
65 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/SceneDelegate.swift:
--------------------------------------------------------------------------------
1 | //
2 | // SceneDelegate.swift
3 | // SSLPinning
4 | //
5 | // Created by Anuj Rai on 25/01/20.
6 | // Copyright © 2020 Anuj Rai. All rights reserved.
7 | //
8 |
9 | import UIKit
10 |
11 | class SceneDelegate: UIResponder, UIWindowSceneDelegate {
12 |
13 | var window: UIWindow?
14 |
15 |
16 | func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) {
17 | // Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`.
18 | // If using a storyboard, the `window` property will automatically be initialized and attached to the scene.
19 | // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead).
20 | guard let _ = (scene as? UIWindowScene) else { return }
21 | }
22 |
23 | func sceneDidDisconnect(_ scene: UIScene) {
24 | // Called as the scene is being released by the system.
25 | // This occurs shortly after the scene enters the background, or when its session is discarded.
26 | // Release any resources associated with this scene that can be re-created the next time the scene connects.
27 | // The scene may re-connect later, as its session was not neccessarily discarded (see `application:didDiscardSceneSessions` instead).
28 | }
29 |
30 | func sceneDidBecomeActive(_ scene: UIScene) {
31 | // Called when the scene has moved from an inactive state to an active state.
32 | // Use this method to restart any tasks that were paused (or not yet started) when the scene was inactive.
33 | }
34 |
35 | func sceneWillResignActive(_ scene: UIScene) {
36 | // Called when the scene will move from an active state to an inactive state.
37 | // This may occur due to temporary interruptions (ex. an incoming phone call).
38 | }
39 |
40 | func sceneWillEnterForeground(_ scene: UIScene) {
41 | // Called as the scene transitions from the background to the foreground.
42 | // Use this method to undo the changes made on entering the background.
43 | }
44 |
45 | func sceneDidEnterBackground(_ scene: UIScene) {
46 | // Called as the scene transitions from the foreground to the background.
47 | // Use this method to save data, release shared resources, and store enough scene-specific state information
48 | // to restore the scene back to its current state.
49 | }
50 |
51 |
52 | }
53 |
54 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning/ServiceManager.swift:
--------------------------------------------------------------------------------
1 | //
2 | // ServiceManager.swift
3 | // SSLPinning
4 | //
5 | // Created by Anuj Rai on 26/01/20.
6 | // Copyright © 2020 Anuj Rai. All rights reserved.
7 | //
8 |
9 | import Foundation
10 | import Security
11 | import CommonCrypto
12 |
13 | class ServiceManager: NSObject {
14 |
15 | static let publicKeyHash = "Gdbmf0GLeR880mGN9WSW1XOL6v7xsVmWO6ks0LxybzU="
16 |
17 | let rsa2048Asn1Header:[UInt8] = [
18 | 0x30, 0x82, 0x01, 0x22, 0x30, 0x0d, 0x06, 0x09, 0x2a, 0x86, 0x48, 0x86,
19 | 0xf7, 0x0d, 0x01, 0x01, 0x01, 0x05, 0x00, 0x03, 0x82, 0x01, 0x0f, 0x00
20 | ]
21 |
22 | private var isCertificatePinning: Bool = false
23 |
24 | private func sha256(data : Data) -> String {
25 | var keyWithHeader = Data(rsa2048Asn1Header)
26 | keyWithHeader.append(data)
27 | var hash = [UInt8](repeating: 0, count: Int(CC_SHA256_DIGEST_LENGTH))
28 |
29 | keyWithHeader.withUnsafeBytes {
30 | _ = CC_SHA256($0, CC_LONG(keyWithHeader.count), &hash)
31 | }
32 |
33 |
34 | return Data(hash).base64EncodedString()
35 | }
36 |
37 | func callAPI(withURL url: URL, isCertificatePinning: Bool, completion: @escaping (String) -> Void) {
38 | let session = URLSession(configuration: .ephemeral, delegate: self, delegateQueue: nil)
39 | self.isCertificatePinning = isCertificatePinning
40 | var responseMessage = ""
41 | let task = session.dataTask(with: url) { (data, response, error) in
42 | if error != nil {
43 | print("error: \(error!.localizedDescription): \(error!)")
44 | responseMessage = "Pinning failed"
45 | } else if data != nil {
46 | let str = String(decoding: data!, as: UTF8.self)
47 | print("Received data:\n\(str)")
48 | if isCertificatePinning {
49 | responseMessage = "Certificate pinning is successfully completed"
50 | }else {
51 | responseMessage = "Public key pinning is successfully completed"
52 | }
53 | }
54 |
55 | DispatchQueue.main.async {
56 | completion(responseMessage)
57 | }
58 |
59 | }
60 | task.resume()
61 |
62 | }
63 |
64 | }
65 |
66 | extension ServiceManager: URLSessionDelegate {
67 |
68 | func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
69 |
70 | guard let serverTrust = challenge.protectionSpace.serverTrust else {
71 | completionHandler(.cancelAuthenticationChallenge, nil);
72 | return
73 | }
74 |
75 | if self.isCertificatePinning {
76 |
77 |
78 | let certificate = SecTrustGetCertificateAtIndex(serverTrust, 0)
79 | // SSL Policies for domain name check
80 | let policy = NSMutableArray()
81 | policy.add(SecPolicyCreateSSL(true, challenge.protectionSpace.host as CFString))
82 |
83 | //evaluate server certifiacte
84 | let isServerTrusted = SecTrustEvaluateWithError(serverTrust, nil)
85 |
86 | //Local and Remote certificate Data
87 | let remoteCertificateData:NSData = SecCertificateCopyData(certificate!)
88 | //let LocalCertificate = Bundle.main.path(forResource: "github.com", ofType: "cer")
89 | let pathToCertificate = Bundle.main.path(forResource: "google", ofType: "cer")
90 | let localCertificateData:NSData = NSData(contentsOfFile: pathToCertificate!)!
91 |
92 | //Compare certificates
93 | if(isServerTrusted && remoteCertificateData.isEqual(to: localCertificateData as Data)){
94 | let credential:URLCredential = URLCredential(trust:serverTrust)
95 | print("Certificate pinning is successfully completed")
96 | completionHandler(.useCredential,credential)
97 | }
98 | else{
99 | completionHandler(.cancelAuthenticationChallenge,nil)
100 | }
101 | } else {
102 | if let serverCertificate = SecTrustGetCertificateAtIndex(serverTrust, 0) {
103 | // Server public key
104 | let serverPublicKey = SecCertificateCopyKey(serverCertificate)
105 | let serverPublicKeyData = SecKeyCopyExternalRepresentation(serverPublicKey!, nil )!
106 | let data:Data = serverPublicKeyData as Data
107 | // Server Hash key
108 | let serverHashKey = sha256(data: data)
109 | // Local Hash Key
110 | let publickKeyLocal = type(of: self).publicKeyHash
111 | if (serverHashKey == publickKeyLocal) {
112 | // Success! This is our server
113 | print("Public key pinning is successfully completed")
114 | completionHandler(.useCredential, URLCredential(trust:serverTrust))
115 | return
116 | }
117 | }
118 | }
119 | }
120 |
121 | }
122 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning.xcodeproj/xcuserdata/Anuj.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
9 |
21 |
22 |
23 |
25 |
37 |
38 |
39 |
41 |
53 |
54 |
55 |
57 |
69 |
70 |
71 |
73 |
85 |
86 |
87 |
89 |
101 |
102 |
103 |
105 |
117 |
118 |
119 |
120 |
121 |
--------------------------------------------------------------------------------
/SSLPinning/SSLPinning.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 50;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 757BB83523DC89CB008CF013 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757BB83423DC89CB008CF013 /* AppDelegate.swift */; };
11 | 757BB83723DC89CB008CF013 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757BB83623DC89CB008CF013 /* SceneDelegate.swift */; };
12 | 757BB83923DC89CB008CF013 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757BB83823DC89CB008CF013 /* ViewController.swift */; };
13 | 757BB83C23DC89CB008CF013 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 757BB83A23DC89CB008CF013 /* Main.storyboard */; };
14 | 757BB83E23DC89CD008CF013 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 757BB83D23DC89CD008CF013 /* Assets.xcassets */; };
15 | 757BB84123DC89CD008CF013 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 757BB83F23DC89CD008CF013 /* LaunchScreen.storyboard */; };
16 | 757BB84C23DC89CD008CF013 /* SSLPinningTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757BB84B23DC89CD008CF013 /* SSLPinningTests.swift */; };
17 | 757BB85723DC89CD008CF013 /* SSLPinningUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757BB85623DC89CD008CF013 /* SSLPinningUITests.swift */; };
18 | 757BB86823DCE36A008CF013 /* ServiceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757BB86723DCE36A008CF013 /* ServiceManager.swift */; };
19 | 757BB86923DCE36A008CF013 /* ServiceManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 757BB86723DCE36A008CF013 /* ServiceManager.swift */; };
20 | 75898460242543EC002746CB /* google.cer in Resources */ = {isa = PBXBuildFile; fileRef = 7589845F242543EC002746CB /* google.cer */; };
21 | /* End PBXBuildFile section */
22 |
23 | /* Begin PBXContainerItemProxy section */
24 | 757BB84823DC89CD008CF013 /* PBXContainerItemProxy */ = {
25 | isa = PBXContainerItemProxy;
26 | containerPortal = 757BB82923DC89CA008CF013 /* Project object */;
27 | proxyType = 1;
28 | remoteGlobalIDString = 757BB83023DC89CB008CF013;
29 | remoteInfo = SSLPinning;
30 | };
31 | 757BB85323DC89CD008CF013 /* PBXContainerItemProxy */ = {
32 | isa = PBXContainerItemProxy;
33 | containerPortal = 757BB82923DC89CA008CF013 /* Project object */;
34 | proxyType = 1;
35 | remoteGlobalIDString = 757BB83023DC89CB008CF013;
36 | remoteInfo = SSLPinning;
37 | };
38 | /* End PBXContainerItemProxy section */
39 |
40 | /* Begin PBXFileReference section */
41 | 757BB83123DC89CB008CF013 /* SSLPinning.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SSLPinning.app; sourceTree = BUILT_PRODUCTS_DIR; };
42 | 757BB83423DC89CB008CF013 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; };
43 | 757BB83623DC89CB008CF013 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = ""; };
44 | 757BB83823DC89CB008CF013 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; };
45 | 757BB83B23DC89CB008CF013 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
46 | 757BB83D23DC89CD008CF013 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
47 | 757BB84023DC89CD008CF013 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
48 | 757BB84223DC89CD008CF013 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
49 | 757BB84723DC89CD008CF013 /* SSLPinningTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SSLPinningTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
50 | 757BB84B23DC89CD008CF013 /* SSLPinningTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSLPinningTests.swift; sourceTree = ""; };
51 | 757BB84D23DC89CD008CF013 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
52 | 757BB85223DC89CD008CF013 /* SSLPinningUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SSLPinningUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
53 | 757BB85623DC89CD008CF013 /* SSLPinningUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSLPinningUITests.swift; sourceTree = ""; };
54 | 757BB85823DC89CD008CF013 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
55 | 757BB86723DCE36A008CF013 /* ServiceManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ServiceManager.swift; sourceTree = ""; };
56 | 7589845F242543EC002746CB /* google.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = google.cer; sourceTree = ""; };
57 | /* End PBXFileReference section */
58 |
59 | /* Begin PBXFrameworksBuildPhase section */
60 | 757BB82E23DC89CB008CF013 /* Frameworks */ = {
61 | isa = PBXFrameworksBuildPhase;
62 | buildActionMask = 2147483647;
63 | files = (
64 | );
65 | runOnlyForDeploymentPostprocessing = 0;
66 | };
67 | 757BB84423DC89CD008CF013 /* Frameworks */ = {
68 | isa = PBXFrameworksBuildPhase;
69 | buildActionMask = 2147483647;
70 | files = (
71 | );
72 | runOnlyForDeploymentPostprocessing = 0;
73 | };
74 | 757BB84F23DC89CD008CF013 /* Frameworks */ = {
75 | isa = PBXFrameworksBuildPhase;
76 | buildActionMask = 2147483647;
77 | files = (
78 | );
79 | runOnlyForDeploymentPostprocessing = 0;
80 | };
81 | /* End PBXFrameworksBuildPhase section */
82 |
83 | /* Begin PBXGroup section */
84 | 757BB82823DC89CA008CF013 = {
85 | isa = PBXGroup;
86 | children = (
87 | 757BB83323DC89CB008CF013 /* SSLPinning */,
88 | 757BB84A23DC89CD008CF013 /* SSLPinningTests */,
89 | 757BB85523DC89CD008CF013 /* SSLPinningUITests */,
90 | 757BB83223DC89CB008CF013 /* Products */,
91 | );
92 | sourceTree = "";
93 | };
94 | 757BB83223DC89CB008CF013 /* Products */ = {
95 | isa = PBXGroup;
96 | children = (
97 | 757BB83123DC89CB008CF013 /* SSLPinning.app */,
98 | 757BB84723DC89CD008CF013 /* SSLPinningTests.xctest */,
99 | 757BB85223DC89CD008CF013 /* SSLPinningUITests.xctest */,
100 | );
101 | name = Products;
102 | sourceTree = "";
103 | };
104 | 757BB83323DC89CB008CF013 /* SSLPinning */ = {
105 | isa = PBXGroup;
106 | children = (
107 | 7589845F242543EC002746CB /* google.cer */,
108 | 757BB83423DC89CB008CF013 /* AppDelegate.swift */,
109 | 757BB83623DC89CB008CF013 /* SceneDelegate.swift */,
110 | 757BB83823DC89CB008CF013 /* ViewController.swift */,
111 | 757BB86723DCE36A008CF013 /* ServiceManager.swift */,
112 | 757BB83A23DC89CB008CF013 /* Main.storyboard */,
113 | 757BB83D23DC89CD008CF013 /* Assets.xcassets */,
114 | 757BB83F23DC89CD008CF013 /* LaunchScreen.storyboard */,
115 | 757BB84223DC89CD008CF013 /* Info.plist */,
116 | );
117 | path = SSLPinning;
118 | sourceTree = "";
119 | };
120 | 757BB84A23DC89CD008CF013 /* SSLPinningTests */ = {
121 | isa = PBXGroup;
122 | children = (
123 | 757BB84B23DC89CD008CF013 /* SSLPinningTests.swift */,
124 | 757BB84D23DC89CD008CF013 /* Info.plist */,
125 | );
126 | path = SSLPinningTests;
127 | sourceTree = "";
128 | };
129 | 757BB85523DC89CD008CF013 /* SSLPinningUITests */ = {
130 | isa = PBXGroup;
131 | children = (
132 | 757BB85623DC89CD008CF013 /* SSLPinningUITests.swift */,
133 | 757BB85823DC89CD008CF013 /* Info.plist */,
134 | );
135 | path = SSLPinningUITests;
136 | sourceTree = "";
137 | };
138 | /* End PBXGroup section */
139 |
140 | /* Begin PBXNativeTarget section */
141 | 757BB83023DC89CB008CF013 /* SSLPinning */ = {
142 | isa = PBXNativeTarget;
143 | buildConfigurationList = 757BB85B23DC89CD008CF013 /* Build configuration list for PBXNativeTarget "SSLPinning" */;
144 | buildPhases = (
145 | 757BB82D23DC89CB008CF013 /* Sources */,
146 | 757BB82E23DC89CB008CF013 /* Frameworks */,
147 | 757BB82F23DC89CB008CF013 /* Resources */,
148 | );
149 | buildRules = (
150 | );
151 | dependencies = (
152 | );
153 | name = SSLPinning;
154 | productName = SSLPinning;
155 | productReference = 757BB83123DC89CB008CF013 /* SSLPinning.app */;
156 | productType = "com.apple.product-type.application";
157 | };
158 | 757BB84623DC89CD008CF013 /* SSLPinningTests */ = {
159 | isa = PBXNativeTarget;
160 | buildConfigurationList = 757BB85E23DC89CD008CF013 /* Build configuration list for PBXNativeTarget "SSLPinningTests" */;
161 | buildPhases = (
162 | 757BB84323DC89CD008CF013 /* Sources */,
163 | 757BB84423DC89CD008CF013 /* Frameworks */,
164 | 757BB84523DC89CD008CF013 /* Resources */,
165 | );
166 | buildRules = (
167 | );
168 | dependencies = (
169 | 757BB84923DC89CD008CF013 /* PBXTargetDependency */,
170 | );
171 | name = SSLPinningTests;
172 | productName = SSLPinningTests;
173 | productReference = 757BB84723DC89CD008CF013 /* SSLPinningTests.xctest */;
174 | productType = "com.apple.product-type.bundle.unit-test";
175 | };
176 | 757BB85123DC89CD008CF013 /* SSLPinningUITests */ = {
177 | isa = PBXNativeTarget;
178 | buildConfigurationList = 757BB86123DC89CD008CF013 /* Build configuration list for PBXNativeTarget "SSLPinningUITests" */;
179 | buildPhases = (
180 | 757BB84E23DC89CD008CF013 /* Sources */,
181 | 757BB84F23DC89CD008CF013 /* Frameworks */,
182 | 757BB85023DC89CD008CF013 /* Resources */,
183 | );
184 | buildRules = (
185 | );
186 | dependencies = (
187 | 757BB85423DC89CD008CF013 /* PBXTargetDependency */,
188 | );
189 | name = SSLPinningUITests;
190 | productName = SSLPinningUITests;
191 | productReference = 757BB85223DC89CD008CF013 /* SSLPinningUITests.xctest */;
192 | productType = "com.apple.product-type.bundle.ui-testing";
193 | };
194 | /* End PBXNativeTarget section */
195 |
196 | /* Begin PBXProject section */
197 | 757BB82923DC89CA008CF013 /* Project object */ = {
198 | isa = PBXProject;
199 | attributes = {
200 | LastSwiftUpdateCheck = 1120;
201 | LastUpgradeCheck = 1120;
202 | ORGANIZATIONNAME = "Anuj Rai";
203 | TargetAttributes = {
204 | 757BB83023DC89CB008CF013 = {
205 | CreatedOnToolsVersion = 11.2.1;
206 | };
207 | 757BB84623DC89CD008CF013 = {
208 | CreatedOnToolsVersion = 11.2.1;
209 | TestTargetID = 757BB83023DC89CB008CF013;
210 | };
211 | 757BB85123DC89CD008CF013 = {
212 | CreatedOnToolsVersion = 11.2.1;
213 | TestTargetID = 757BB83023DC89CB008CF013;
214 | };
215 | };
216 | };
217 | buildConfigurationList = 757BB82C23DC89CA008CF013 /* Build configuration list for PBXProject "SSLPinning" */;
218 | compatibilityVersion = "Xcode 9.3";
219 | developmentRegion = en;
220 | hasScannedForEncodings = 0;
221 | knownRegions = (
222 | en,
223 | Base,
224 | );
225 | mainGroup = 757BB82823DC89CA008CF013;
226 | productRefGroup = 757BB83223DC89CB008CF013 /* Products */;
227 | projectDirPath = "";
228 | projectRoot = "";
229 | targets = (
230 | 757BB83023DC89CB008CF013 /* SSLPinning */,
231 | 757BB84623DC89CD008CF013 /* SSLPinningTests */,
232 | 757BB85123DC89CD008CF013 /* SSLPinningUITests */,
233 | );
234 | };
235 | /* End PBXProject section */
236 |
237 | /* Begin PBXResourcesBuildPhase section */
238 | 757BB82F23DC89CB008CF013 /* Resources */ = {
239 | isa = PBXResourcesBuildPhase;
240 | buildActionMask = 2147483647;
241 | files = (
242 | 757BB84123DC89CD008CF013 /* LaunchScreen.storyboard in Resources */,
243 | 757BB83E23DC89CD008CF013 /* Assets.xcassets in Resources */,
244 | 757BB83C23DC89CB008CF013 /* Main.storyboard in Resources */,
245 | 75898460242543EC002746CB /* google.cer in Resources */,
246 | );
247 | runOnlyForDeploymentPostprocessing = 0;
248 | };
249 | 757BB84523DC89CD008CF013 /* Resources */ = {
250 | isa = PBXResourcesBuildPhase;
251 | buildActionMask = 2147483647;
252 | files = (
253 | );
254 | runOnlyForDeploymentPostprocessing = 0;
255 | };
256 | 757BB85023DC89CD008CF013 /* Resources */ = {
257 | isa = PBXResourcesBuildPhase;
258 | buildActionMask = 2147483647;
259 | files = (
260 | );
261 | runOnlyForDeploymentPostprocessing = 0;
262 | };
263 | /* End PBXResourcesBuildPhase section */
264 |
265 | /* Begin PBXSourcesBuildPhase section */
266 | 757BB82D23DC89CB008CF013 /* Sources */ = {
267 | isa = PBXSourcesBuildPhase;
268 | buildActionMask = 2147483647;
269 | files = (
270 | 757BB83923DC89CB008CF013 /* ViewController.swift in Sources */,
271 | 757BB83523DC89CB008CF013 /* AppDelegate.swift in Sources */,
272 | 757BB83723DC89CB008CF013 /* SceneDelegate.swift in Sources */,
273 | 757BB86823DCE36A008CF013 /* ServiceManager.swift in Sources */,
274 | );
275 | runOnlyForDeploymentPostprocessing = 0;
276 | };
277 | 757BB84323DC89CD008CF013 /* Sources */ = {
278 | isa = PBXSourcesBuildPhase;
279 | buildActionMask = 2147483647;
280 | files = (
281 | 757BB84C23DC89CD008CF013 /* SSLPinningTests.swift in Sources */,
282 | 757BB86923DCE36A008CF013 /* ServiceManager.swift in Sources */,
283 | );
284 | runOnlyForDeploymentPostprocessing = 0;
285 | };
286 | 757BB84E23DC89CD008CF013 /* Sources */ = {
287 | isa = PBXSourcesBuildPhase;
288 | buildActionMask = 2147483647;
289 | files = (
290 | 757BB85723DC89CD008CF013 /* SSLPinningUITests.swift in Sources */,
291 | );
292 | runOnlyForDeploymentPostprocessing = 0;
293 | };
294 | /* End PBXSourcesBuildPhase section */
295 |
296 | /* Begin PBXTargetDependency section */
297 | 757BB84923DC89CD008CF013 /* PBXTargetDependency */ = {
298 | isa = PBXTargetDependency;
299 | target = 757BB83023DC89CB008CF013 /* SSLPinning */;
300 | targetProxy = 757BB84823DC89CD008CF013 /* PBXContainerItemProxy */;
301 | };
302 | 757BB85423DC89CD008CF013 /* PBXTargetDependency */ = {
303 | isa = PBXTargetDependency;
304 | target = 757BB83023DC89CB008CF013 /* SSLPinning */;
305 | targetProxy = 757BB85323DC89CD008CF013 /* PBXContainerItemProxy */;
306 | };
307 | /* End PBXTargetDependency section */
308 |
309 | /* Begin PBXVariantGroup section */
310 | 757BB83A23DC89CB008CF013 /* Main.storyboard */ = {
311 | isa = PBXVariantGroup;
312 | children = (
313 | 757BB83B23DC89CB008CF013 /* Base */,
314 | );
315 | name = Main.storyboard;
316 | sourceTree = "";
317 | };
318 | 757BB83F23DC89CD008CF013 /* LaunchScreen.storyboard */ = {
319 | isa = PBXVariantGroup;
320 | children = (
321 | 757BB84023DC89CD008CF013 /* Base */,
322 | );
323 | name = LaunchScreen.storyboard;
324 | sourceTree = "";
325 | };
326 | /* End PBXVariantGroup section */
327 |
328 | /* Begin XCBuildConfiguration section */
329 | 757BB85923DC89CD008CF013 /* Debug */ = {
330 | isa = XCBuildConfiguration;
331 | buildSettings = {
332 | ALWAYS_SEARCH_USER_PATHS = NO;
333 | CLANG_ANALYZER_NONNULL = YES;
334 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
336 | CLANG_CXX_LIBRARY = "libc++";
337 | CLANG_ENABLE_MODULES = YES;
338 | CLANG_ENABLE_OBJC_ARC = YES;
339 | CLANG_ENABLE_OBJC_WEAK = YES;
340 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
341 | CLANG_WARN_BOOL_CONVERSION = YES;
342 | CLANG_WARN_COMMA = YES;
343 | CLANG_WARN_CONSTANT_CONVERSION = YES;
344 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
345 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
346 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
347 | CLANG_WARN_EMPTY_BODY = YES;
348 | CLANG_WARN_ENUM_CONVERSION = YES;
349 | CLANG_WARN_INFINITE_RECURSION = YES;
350 | CLANG_WARN_INT_CONVERSION = YES;
351 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
352 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
353 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
354 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
355 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
356 | CLANG_WARN_STRICT_PROTOTYPES = YES;
357 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
358 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
359 | CLANG_WARN_UNREACHABLE_CODE = YES;
360 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
361 | COPY_PHASE_STRIP = NO;
362 | DEBUG_INFORMATION_FORMAT = dwarf;
363 | ENABLE_STRICT_OBJC_MSGSEND = YES;
364 | ENABLE_TESTABILITY = YES;
365 | GCC_C_LANGUAGE_STANDARD = gnu11;
366 | GCC_DYNAMIC_NO_PIC = NO;
367 | GCC_NO_COMMON_BLOCKS = YES;
368 | GCC_OPTIMIZATION_LEVEL = 0;
369 | GCC_PREPROCESSOR_DEFINITIONS = (
370 | "DEBUG=1",
371 | "$(inherited)",
372 | );
373 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
374 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
375 | GCC_WARN_UNDECLARED_SELECTOR = YES;
376 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
377 | GCC_WARN_UNUSED_FUNCTION = YES;
378 | GCC_WARN_UNUSED_VARIABLE = YES;
379 | IPHONEOS_DEPLOYMENT_TARGET = 13.2;
380 | MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
381 | MTL_FAST_MATH = YES;
382 | ONLY_ACTIVE_ARCH = YES;
383 | SDKROOT = iphoneos;
384 | SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
385 | SWIFT_OPTIMIZATION_LEVEL = "-Onone";
386 | };
387 | name = Debug;
388 | };
389 | 757BB85A23DC89CD008CF013 /* Release */ = {
390 | isa = XCBuildConfiguration;
391 | buildSettings = {
392 | ALWAYS_SEARCH_USER_PATHS = NO;
393 | CLANG_ANALYZER_NONNULL = YES;
394 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
395 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
396 | CLANG_CXX_LIBRARY = "libc++";
397 | CLANG_ENABLE_MODULES = YES;
398 | CLANG_ENABLE_OBJC_ARC = YES;
399 | CLANG_ENABLE_OBJC_WEAK = YES;
400 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
401 | CLANG_WARN_BOOL_CONVERSION = YES;
402 | CLANG_WARN_COMMA = YES;
403 | CLANG_WARN_CONSTANT_CONVERSION = YES;
404 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
405 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
406 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
407 | CLANG_WARN_EMPTY_BODY = YES;
408 | CLANG_WARN_ENUM_CONVERSION = YES;
409 | CLANG_WARN_INFINITE_RECURSION = YES;
410 | CLANG_WARN_INT_CONVERSION = YES;
411 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
412 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
413 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
414 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
415 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
416 | CLANG_WARN_STRICT_PROTOTYPES = YES;
417 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
418 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
419 | CLANG_WARN_UNREACHABLE_CODE = YES;
420 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
421 | COPY_PHASE_STRIP = NO;
422 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
423 | ENABLE_NS_ASSERTIONS = NO;
424 | ENABLE_STRICT_OBJC_MSGSEND = YES;
425 | GCC_C_LANGUAGE_STANDARD = gnu11;
426 | GCC_NO_COMMON_BLOCKS = YES;
427 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
428 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
429 | GCC_WARN_UNDECLARED_SELECTOR = YES;
430 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
431 | GCC_WARN_UNUSED_FUNCTION = YES;
432 | GCC_WARN_UNUSED_VARIABLE = YES;
433 | IPHONEOS_DEPLOYMENT_TARGET = 13.2;
434 | MTL_ENABLE_DEBUG_INFO = NO;
435 | MTL_FAST_MATH = YES;
436 | SDKROOT = iphoneos;
437 | SWIFT_COMPILATION_MODE = wholemodule;
438 | SWIFT_OPTIMIZATION_LEVEL = "-O";
439 | VALIDATE_PRODUCT = YES;
440 | };
441 | name = Release;
442 | };
443 | 757BB85C23DC89CD008CF013 /* Debug */ = {
444 | isa = XCBuildConfiguration;
445 | buildSettings = {
446 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
447 | CODE_SIGN_STYLE = Automatic;
448 | INFOPLIST_FILE = SSLPinning/Info.plist;
449 | LD_RUNPATH_SEARCH_PATHS = (
450 | "$(inherited)",
451 | "@executable_path/Frameworks",
452 | );
453 | PRODUCT_BUNDLE_IDENTIFIER = com.anuj.SSLPinning;
454 | PRODUCT_NAME = "$(TARGET_NAME)";
455 | SWIFT_VERSION = 5.0;
456 | TARGETED_DEVICE_FAMILY = "1,2";
457 | };
458 | name = Debug;
459 | };
460 | 757BB85D23DC89CD008CF013 /* Release */ = {
461 | isa = XCBuildConfiguration;
462 | buildSettings = {
463 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
464 | CODE_SIGN_STYLE = Automatic;
465 | INFOPLIST_FILE = SSLPinning/Info.plist;
466 | LD_RUNPATH_SEARCH_PATHS = (
467 | "$(inherited)",
468 | "@executable_path/Frameworks",
469 | );
470 | PRODUCT_BUNDLE_IDENTIFIER = com.anuj.SSLPinning;
471 | PRODUCT_NAME = "$(TARGET_NAME)";
472 | SWIFT_VERSION = 5.0;
473 | TARGETED_DEVICE_FAMILY = "1,2";
474 | };
475 | name = Release;
476 | };
477 | 757BB85F23DC89CD008CF013 /* Debug */ = {
478 | isa = XCBuildConfiguration;
479 | buildSettings = {
480 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
481 | BUNDLE_LOADER = "$(TEST_HOST)";
482 | CODE_SIGN_STYLE = Automatic;
483 | INFOPLIST_FILE = SSLPinningTests/Info.plist;
484 | IPHONEOS_DEPLOYMENT_TARGET = 13.2;
485 | LD_RUNPATH_SEARCH_PATHS = (
486 | "$(inherited)",
487 | "@executable_path/Frameworks",
488 | "@loader_path/Frameworks",
489 | );
490 | PRODUCT_BUNDLE_IDENTIFIER = com.anuj.SSLPinningTests;
491 | PRODUCT_NAME = "$(TARGET_NAME)";
492 | SWIFT_VERSION = 5.0;
493 | TARGETED_DEVICE_FAMILY = "1,2";
494 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SSLPinning.app/SSLPinning";
495 | };
496 | name = Debug;
497 | };
498 | 757BB86023DC89CD008CF013 /* Release */ = {
499 | isa = XCBuildConfiguration;
500 | buildSettings = {
501 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
502 | BUNDLE_LOADER = "$(TEST_HOST)";
503 | CODE_SIGN_STYLE = Automatic;
504 | INFOPLIST_FILE = SSLPinningTests/Info.plist;
505 | IPHONEOS_DEPLOYMENT_TARGET = 13.2;
506 | LD_RUNPATH_SEARCH_PATHS = (
507 | "$(inherited)",
508 | "@executable_path/Frameworks",
509 | "@loader_path/Frameworks",
510 | );
511 | PRODUCT_BUNDLE_IDENTIFIER = com.anuj.SSLPinningTests;
512 | PRODUCT_NAME = "$(TARGET_NAME)";
513 | SWIFT_VERSION = 5.0;
514 | TARGETED_DEVICE_FAMILY = "1,2";
515 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SSLPinning.app/SSLPinning";
516 | };
517 | name = Release;
518 | };
519 | 757BB86223DC89CD008CF013 /* Debug */ = {
520 | isa = XCBuildConfiguration;
521 | buildSettings = {
522 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
523 | CODE_SIGN_STYLE = Automatic;
524 | INFOPLIST_FILE = SSLPinningUITests/Info.plist;
525 | LD_RUNPATH_SEARCH_PATHS = (
526 | "$(inherited)",
527 | "@executable_path/Frameworks",
528 | "@loader_path/Frameworks",
529 | );
530 | PRODUCT_BUNDLE_IDENTIFIER = com.anuj.SSLPinningUITests;
531 | PRODUCT_NAME = "$(TARGET_NAME)";
532 | SWIFT_VERSION = 5.0;
533 | TARGETED_DEVICE_FAMILY = "1,2";
534 | TEST_TARGET_NAME = SSLPinning;
535 | };
536 | name = Debug;
537 | };
538 | 757BB86323DC89CD008CF013 /* Release */ = {
539 | isa = XCBuildConfiguration;
540 | buildSettings = {
541 | ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES;
542 | CODE_SIGN_STYLE = Automatic;
543 | INFOPLIST_FILE = SSLPinningUITests/Info.plist;
544 | LD_RUNPATH_SEARCH_PATHS = (
545 | "$(inherited)",
546 | "@executable_path/Frameworks",
547 | "@loader_path/Frameworks",
548 | );
549 | PRODUCT_BUNDLE_IDENTIFIER = com.anuj.SSLPinningUITests;
550 | PRODUCT_NAME = "$(TARGET_NAME)";
551 | SWIFT_VERSION = 5.0;
552 | TARGETED_DEVICE_FAMILY = "1,2";
553 | TEST_TARGET_NAME = SSLPinning;
554 | };
555 | name = Release;
556 | };
557 | /* End XCBuildConfiguration section */
558 |
559 | /* Begin XCConfigurationList section */
560 | 757BB82C23DC89CA008CF013 /* Build configuration list for PBXProject "SSLPinning" */ = {
561 | isa = XCConfigurationList;
562 | buildConfigurations = (
563 | 757BB85923DC89CD008CF013 /* Debug */,
564 | 757BB85A23DC89CD008CF013 /* Release */,
565 | );
566 | defaultConfigurationIsVisible = 0;
567 | defaultConfigurationName = Release;
568 | };
569 | 757BB85B23DC89CD008CF013 /* Build configuration list for PBXNativeTarget "SSLPinning" */ = {
570 | isa = XCConfigurationList;
571 | buildConfigurations = (
572 | 757BB85C23DC89CD008CF013 /* Debug */,
573 | 757BB85D23DC89CD008CF013 /* Release */,
574 | );
575 | defaultConfigurationIsVisible = 0;
576 | defaultConfigurationName = Release;
577 | };
578 | 757BB85E23DC89CD008CF013 /* Build configuration list for PBXNativeTarget "SSLPinningTests" */ = {
579 | isa = XCConfigurationList;
580 | buildConfigurations = (
581 | 757BB85F23DC89CD008CF013 /* Debug */,
582 | 757BB86023DC89CD008CF013 /* Release */,
583 | );
584 | defaultConfigurationIsVisible = 0;
585 | defaultConfigurationName = Release;
586 | };
587 | 757BB86123DC89CD008CF013 /* Build configuration list for PBXNativeTarget "SSLPinningUITests" */ = {
588 | isa = XCConfigurationList;
589 | buildConfigurations = (
590 | 757BB86223DC89CD008CF013 /* Debug */,
591 | 757BB86323DC89CD008CF013 /* Release */,
592 | );
593 | defaultConfigurationIsVisible = 0;
594 | defaultConfigurationName = Release;
595 | };
596 | /* End XCConfigurationList section */
597 | };
598 | rootObject = 757BB82923DC89CA008CF013 /* Project object */;
599 | }
600 |
--------------------------------------------------------------------------------