From d19d7e4adb06decd9a4d721b1a9b5d063e6b8212 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Mon, 9 Oct 2023 09:47:49 +0200 Subject: [PATCH 1/2] refactor: update baseURL in APIClient.swift --- IVPNClient/Managers/APIClient.swift | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/IVPNClient/Managers/APIClient.swift b/IVPNClient/Managers/APIClient.swift index aa6942fec..226d69a85 100644 --- a/IVPNClient/Managers/APIClient.swift +++ b/IVPNClient/Managers/APIClient.swift @@ -98,7 +98,15 @@ class APIClient: NSObject { private var hostName = UserDefaults.shared.apiHostName private var baseURL: URL { - return URL(string: "https://\(hostName)")! + if let url = URL(string: "https://\(hostName)") { + return url + } + + if let url = URL(string: "https://[\(hostName)]") { + return url + } + + return URL(string: "https://\(Config.ApiHostName)")! } private var userAgent: String { From 9d3724b54fd27ba4a42823ac56b3839e9e60ec96 Mon Sep 17 00:00:00 2001 From: Juraj Hilje Date: Mon, 9 Oct 2023 09:52:31 +0200 Subject: [PATCH 2/2] refactor: add NSExceptionDomains in Info.plist List API IP addresses to allow performing manual server trust authentication --- IVPNClient/Info.plist | 62 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) diff --git a/IVPNClient/Info.plist b/IVPNClient/Info.plist index 793cbe51c..96570728d 100644 --- a/IVPNClient/Info.plist +++ b/IVPNClient/Info.plist @@ -74,5 +74,67 @@ UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight + NSAppTransportSecurity + + NSExceptionDomains + + 198.50.177.220 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 149.56.162.156 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 198.50.177.222 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 149.56.162.159 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 198.50.177.223 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 2607:5300:203:1735::8888 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 2607:5300:203:1735::8 + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + 2607:5300:203:1735:6580:7300:0:aaaa + + NSExceptionAllowsInsecureHTTPLoads + + NSExceptionMinimumTLSVersion + TLSv1.2 + + +