Browse Source

fix checkTrustedChallenge [rollback] + host

Signed-off-by: marinofaggiana <marino@marinofaggiana.com>
marinofaggiana 3 năm trước cách đây
mục cha
commit
797e69dfc5
1 tập tin đã thay đổi với 2 bổ sung15 xóa
  1. 2 15
      iOSClient/Security/NCViewCertificateDetails.swift

+ 2 - 15
iOSClient/Security/NCViewCertificateDetails.swift

@@ -42,31 +42,18 @@ class NCViewCertificateDetails: UIViewController  {
     private let directoryCertificate = CCUtility.getDirectoryCerificates()!
 
     public var delegate: NCViewCertificateDetailsDelegate?
-    @objc public var host: String?
+    @objc public var host: String = ""
 
     // MARK: - View Life Cycle
 
     override func viewDidLoad() {
         super.viewDidLoad()
         
-        var certificatePath = directoryCertificate + "/" + NCGlobal.shared.certificateTmpV2 + ".txt"
-        let hostPushNotificationServerProxy = URL(string: NCBrandOptions.shared.pushNotificationServerProxy)?.host
 
         self.navigationItem.title = NSLocalizedString("_certificate_details_", comment: "")
         buttonCancel.title = NSLocalizedString("_close_", comment: "")
         
-        if host == hostPushNotificationServerProxy {
-            certificatePath = directoryCertificate + "/" + NCGlobal.shared.certificatePushNotificationServerProxy
-        } else {
-            if let host = host {
-                certificatePath = directoryCertificate + "/" + host + ".der"
-            } else {
-                if let host = URL(string: appDelegate.urlBase)?.host {
-                    certificatePath = directoryCertificate + "/" + host + ".der"
-                }
-            }
-        }
-        
+        let certificatePath = directoryCertificate + "/" + host + ".der"
         if FileManager.default.fileExists(atPath: certificatePath) {
             do {
                 let text = try String(contentsOfFile: certificatePath, encoding: .utf8)