Skip to content

Commit 6067db0

Browse files
committed
Merge branch 'release/2.4.5'
2 parents 5371905 + 68cba49 commit 6067db0

File tree

8 files changed

+57
-52
lines changed

8 files changed

+57
-52
lines changed

Cryptomator.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,7 +3260,7 @@
32603260
GCC_WARN_UNUSED_FUNCTION = YES;
32613261
GCC_WARN_UNUSED_VARIABLE = YES;
32623262
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
3263-
MARKETING_VERSION = 2.4.4;
3263+
MARKETING_VERSION = 2.4.5;
32643264
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
32653265
MTL_FAST_MATH = YES;
32663266
ONLY_ACTIVE_ARCH = YES;
@@ -3322,7 +3322,7 @@
33223322
GCC_WARN_UNUSED_FUNCTION = YES;
33233323
GCC_WARN_UNUSED_VARIABLE = YES;
33243324
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
3325-
MARKETING_VERSION = 2.4.4;
3325+
MARKETING_VERSION = 2.4.5;
33263326
MTL_ENABLE_DEBUG_INFO = NO;
33273327
MTL_FAST_MATH = YES;
33283328
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=200 -Xfrontend -warn-long-function-bodies=200";

Cryptomator/WebDAV/WebDAVAuthentication.swift

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -42,35 +42,6 @@ struct WebDAVAuthentication: View {
4242
.introspectTableView(customize: { tableView in
4343
tableView.backgroundColor = .cryptomatorBackground
4444
})
45-
.alert(isPresented: $viewModel.showUntrustedCertificateError) {
46-
untrustedCertificateAlert
47-
}
48-
.alert(isPresented: $viewModel.showAllowInsecureConnectionAlert) {
49-
insecureConnectionAlert
50-
}
51-
}
52-
53-
private var untrustedCertificateAlert: Alert {
54-
Alert(title: Text(LocalizedString.getValue("untrustedTLSCertificate.title")),
55-
message: Text(LocalizedString.getValue("untrustedTLSCertificate.message")),
56-
primaryButton: .default(Text(LocalizedString.getValue("untrustedTLSCertificate.add")),
57-
action: {
58-
viewModel.allowCertificate()
59-
}),
60-
secondaryButton: .cancel(Text(LocalizedString.getValue("untrustedTLSCertificate.dismiss"))))
61-
}
62-
63-
private var insecureConnectionAlert: Alert {
64-
Alert(title: Text(LocalizedString.getValue("webDAVAuthentication.httpConnection.alert.title")),
65-
message: Text(LocalizedString.getValue("webDAVAuthentication.httpConnection.alert.message")),
66-
primaryButton: .default(Text(LocalizedString.getValue("webDAVAuthentication.httpConnection.change")),
67-
action: {
68-
viewModel.saveAccountWithTransformedURL()
69-
}),
70-
secondaryButton: .destructive(Text(LocalizedString.getValue("webDAVAuthentication.httpConnection.continue")),
71-
action: {
72-
viewModel.saveAccountWithInsecureConnection()
73-
}))
7445
}
7546
}
7647

Cryptomator/WebDAV/WebDAVAuthenticationViewController.swift

Lines changed: 50 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,11 @@ class WebDAVAuthenticationViewController: UIViewController {
6060
hud?.transformToSelfDismissingSuccess().then {
6161
self.coordinator?.authenticated(with: credential)
6262
}
63-
case .initial, .insecureConnectionNotAllowed, .untrustedCertificate:
63+
case .insecureConnectionNotAllowed:
64+
showInsecureConnectionAlert()
65+
case let .untrustedCertificate(certificate: certificate, url: url):
66+
showUntrustedCertificateAlert(certificate: certificate, url: url)
67+
case .initial:
6468
break
6569
}
6670
}
@@ -86,6 +90,51 @@ class WebDAVAuthenticationViewController: UIViewController {
8690
hud?.showLoadingIndicator()
8791
}
8892

93+
private func showUntrustedCertificateAlert(certificate: TLSCertificate, url: URL) {
94+
let precondition: Promise<Void>
95+
if let hud = hud {
96+
precondition = hud.dismiss(animated: true)
97+
} else {
98+
precondition = Promise(())
99+
}
100+
precondition.then { [weak self] in
101+
let message = String(format: LocalizedString.getValue("untrustedTLSCertificate.message"), url.absoluteString, certificate.fingerprint)
102+
let alertController = UIAlertController(title: LocalizedString.getValue("untrustedTLSCertificate.title"),
103+
message: message,
104+
preferredStyle: .alert)
105+
let addAction = UIAlertAction(title: LocalizedString.getValue("untrustedTLSCertificate.add"),
106+
style: .default,
107+
handler: { _ in self?.viewModel.saveAccountWithCertificate() })
108+
alertController.addAction(addAction)
109+
alertController.addAction(UIAlertAction(title: LocalizedString.getValue("untrustedTLSCertificate.dismiss"), style: .cancel))
110+
self?.present(alertController, animated: true)
111+
}
112+
}
113+
114+
private func showInsecureConnectionAlert() {
115+
let precondition: Promise<Void>
116+
if let hud = hud {
117+
precondition = hud.dismiss(animated: true)
118+
} else {
119+
precondition = Promise(())
120+
}
121+
precondition.then { [weak self] in
122+
let alertController = UIAlertController(title: LocalizedString.getValue("webDAVAuthentication.httpConnection.alert.title"),
123+
message: LocalizedString.getValue("webDAVAuthentication.httpConnection.alert.message"),
124+
preferredStyle: .alert)
125+
let changeToHTTPSAction = UIAlertAction(title: LocalizedString.getValue("webDAVAuthentication.httpConnection.change"), style: .default, handler: { _ in
126+
self?.viewModel.saveAccountWithTransformedURL()
127+
})
128+
129+
alertController.addAction(changeToHTTPSAction)
130+
alertController.preferredAction = changeToHTTPSAction
131+
alertController.addAction(UIAlertAction(title: LocalizedString.getValue("webDAVAuthentication.httpConnection.continue"), style: .destructive, handler: { _ in
132+
self?.viewModel.saveAccountWithInsecureConnection()
133+
}))
134+
self?.present(alertController, animated: true)
135+
}
136+
}
137+
89138
@objc func cancel() {
90139
coordinator?.cancel()
91140
}

fastlane/changelog.txt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
- Added download progress indication to Google Drive and WebDAV (#276, #293)
2-
- Added upload progress indication to WebDAV (#293)
3-
- Added background download/upload support to pCloud (#218, #293)
4-
- Fixed error when trying to use self-signed certificates with WebDAV (#291)
1+
- Fixed adding WebDAV connection stuck at "Authenticating…" when using self-signed certificate (#295, #298)
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
- Anzeige des Download-Fortschritts zu Google Drive und WebDAV hinzugefügt (#276, #293)
2-
- Anzeige des Upload-Fortschritts zu WebDAV hinzugefügt (#293)
3-
- Hintergrund-Download/Upload-Unterstützung zu pCloud hinzugefügt (#218, #293)
4-
- Fehler behoben, wenn versucht wurde, selbstsignierte Zertifikate mit WebDAV zu verwenden (#291)
1+
- Hinzufügen von WebDAV-Verbindungen behoben, die bei "Authentifizierung …" hingen, wenn ein selbstsigniertes Zertifikat verwendet wurde (#295, #298)
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
- Added download progress indication to Google Drive and WebDAV (#276, #293)
2-
- Added upload progress indication to WebDAV (#293)
3-
- Added background download/upload support to pCloud (#218, #293)
4-
- Fixed error when trying to use self-signed certificates with WebDAV (#291)
1+
- Fixed adding WebDAV connection stuck at "Authenticating…" when using self-signed certificate (#295, #298)
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
- Anzeige des Download-Fortschritts zu Google Drive und WebDAV hinzugefügt (#276, #293)
2-
- Anzeige des Upload-Fortschritts zu WebDAV hinzugefügt (#293)
3-
- Hintergrund-Download/Upload-Unterstützung zu pCloud hinzugefügt (#218, #293)
4-
- Fehler behoben, wenn versucht wurde, selbstsignierte Zertifikate mit WebDAV zu verwenden (#291)
1+
- Hinzufügen von WebDAV-Verbindungen behoben, die bei "Authentifizierung …" hingen, wenn ein selbstsigniertes Zertifikat verwendet wurde (#295, #298)
Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
- Added download progress indication to Google Drive and WebDAV (#276, #293)
2-
- Added upload progress indication to WebDAV (#293)
3-
- Added background download/upload support to pCloud (#218, #293)
4-
- Fixed error when trying to use self-signed certificates with WebDAV (#291)
1+
- Fixed adding WebDAV connection stuck at "Authenticating…" when using self-signed certificate (#295, #298)

0 commit comments

Comments
 (0)