Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/ios.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarino Faggiana <marino@marinofaggiana.com>2022-11-04 14:39:26 +0300
committerMarino Faggiana <marino@marinofaggiana.com>2022-11-04 14:39:26 +0300
commitaa1231e3983b273d02c81a9763b49a7462d333a3 (patch)
tree68b1e0b052b58b1d7d6ea48236116fe3e9a5f39f
parent818a5f5f50a90d8fb4b8c3f303cb32db769886aa (diff)
fix certificate
Signed-off-by: Marino Faggiana <marino@marinofaggiana.com>
-rw-r--r--iOSClient/Login/NCLoginWeb.swift10
-rw-r--r--iOSClient/Networking/NCNetworking.swift7
2 files changed, 9 insertions, 8 deletions
diff --git a/iOSClient/Login/NCLoginWeb.swift b/iOSClient/Login/NCLoginWeb.swift
index ce5565806..871ba83d4 100644
--- a/iOSClient/Login/NCLoginWeb.swift
+++ b/iOSClient/Login/NCLoginWeb.swift
@@ -259,10 +259,12 @@ extension NCLoginWeb: WKNavigationDelegate {
}
func webView(_ webView: WKWebView, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) {
- if let serverTrust = challenge.protectionSpace.serverTrust {
- completionHandler(Foundation.URLSession.AuthChallengeDisposition.useCredential, URLCredential(trust: serverTrust))
- } else {
- completionHandler(URLSession.AuthChallengeDisposition.useCredential, nil)
+ DispatchQueue.global().async {
+ if let serverTrust = challenge.protectionSpace.serverTrust {
+ completionHandler(Foundation.URLSession.AuthChallengeDisposition.useCredential, URLCredential(trust: serverTrust))
+ } else {
+ completionHandler(URLSession.AuthChallengeDisposition.useCredential, nil)
+ }
}
}
diff --git a/iOSClient/Networking/NCNetworking.swift b/iOSClient/Networking/NCNetworking.swift
index 9852ba384..576c5f956 100644
--- a/iOSClient/Networking/NCNetworking.swift
+++ b/iOSClient/Networking/NCNetworking.swift
@@ -207,9 +207,8 @@ import Photos
let certificateAtPath = directoryCertificate + "/" + host + ".tmp"
let certificateToPath = directoryCertificate + "/" + host + ".der"
- if !NCUtilityFileSystem.shared.moveFile(atPath: certificateAtPath, toPath: certificateToPath) {
- let error = NKError(errorCode: NCGlobal.shared.errorCreationFile, errorDescription: "_error_creation_file_")
- NCContentPresenter.shared.showError(error: error, priority: .max)
+ if !NCUtilityFileSystem.shared.copyFile(atPath: certificateAtPath, toPath: certificateToPath) {
+ NKCommon.shared.writeLog("[ERROR] Write certificare error")
}
}
@@ -221,7 +220,7 @@ import Photos
let x509cert = d2i_X509_bio(mem, nil)
if x509cert == nil {
- print("[LOG] OpenSSL couldn't parse X509 Certificate")
+ NKCommon.shared.writeLog("[ERROR] OpenSSL couldn't parse X509 Certificate")
} else {
// save details
if FileManager.default.fileExists(atPath: certNamePathTXT) {