     class func loadTrustedCertificates() {
         do {
             let rawdata = try Data(contentsOf: URL( string: self.getPersistensePath() ?? "" )!)
-            if let unarchive = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(rawdata) as? [AnyHashable: Any] {
+            if let unarchive = try NSKeyedUnarchiver.unarchiveTopLevelObjectWithData(rawdata) as? [String: Any] {
                 trustedCertificates = unarchive
             }
         } catch {

        // against policy setting to ignore certificate errors and so on.
        var evaluateResult: SecTrustResultType = .invalid
        guard let serverTrust = serverTrust else {
            return false
        }
        SecTrustEvaluate(serverTrust, &evaluateResult)

        }
    }

    class func storeCertificateData(_ certificate: CFData?, forDomain domain: String) {
        let certificateData = certificate as Data?
        trustedCertificates[domain] = certificateData
        self.saveTrustedCertificates()
    }

    class func certificateData(forDomain domain: String) -> CFData? {
        guard let certificateData = trustedCertificates[domain] as? Data else { return nil  }
        return certificateData as CFData
    }
