Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 6 additions & 72 deletions DP3TApp.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

19 changes: 10 additions & 9 deletions DP3TApp/Logic/Networking/Base/URLSession+pinning.swift
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ class CertificateEvaluator: NSObject, URLSessionDelegate {

let bundle = Bundle.main

// all these hosts have a seperate certificate
let hosts = ["www.pt1.bfs.admin.ch",
"www.pt1-d.bfs.admin.ch",
"www.pt1-a.bfs.admin.ch",
Expand All @@ -96,16 +95,18 @@ class CertificateEvaluator: NSObject, URLSessionDelegate {
"www.pt-a.bfs.admin.ch",
"www.pt-t.bfs.admin.ch",
"www.pt.bfs.admin.ch"]
for host in hosts {
if let certificate = bundle.getCertificate(with: host) {
let evaluator = UBPinnedCertificatesTrustEvaluator(certificates: [certificate],
acceptSelfSignedCertificates: true,
performDefaultValidation: false,
validateHost: true)

if let QuovadisRootCA = bundle.getCertificate(with: "QuoVadis-Root-CA-2-G3", fileExtension: "cer") {
for host in hosts {
let evaluator = UBPinnedCertificatesTrustEvaluator(certificates: [QuovadisRootCA],
acceptSelfSignedCertificates: true,
performDefaultValidation: false,
validateHost: true)
evaluators[host] = evaluator
} else {
assertionFailure("Could not load certificate for pinned host")

}
} else {
assertionFailure("Could not load certificate for pinned host")
}

return UBServerTrustManager(evaluators: evaluators)
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.