diff --git a/Passepartout/Sources/AppConstants.swift b/Passepartout/Sources/AppConstants.swift index ea58dafe..4315ab79 100644 --- a/Passepartout/Sources/AppConstants.swift +++ b/Passepartout/Sources/AppConstants.swift @@ -47,7 +47,7 @@ public class AppConstants { } public class VPN { - public static func baseConfiguration() -> TunnelKitProvider.Configuration { + public static var baseConfiguration: TunnelKitProvider.ConfigurationBuilder = { let sessionBuilder = SessionProxy.ConfigurationBuilder(ca: CryptoContainer(pem: "")) var builder = TunnelKitProvider.ConfigurationBuilder(sessionConfiguration: sessionBuilder.build()) builder.mtu = 1250 @@ -55,9 +55,9 @@ public class AppConstants { // builder.debugLogFormat = "$Dyyyy-MM-dd HH:mm:ss.SSS$d $L $N.$F:$l - $M" // builder.debugLogFormat = "$DHH:mm:ss$d $N.$F:$l - $M" builder.debugLogFormat = Log.debugFormat - return builder.build() - } - + return builder + }() + private static let connectivityStrings: [String] = [ "https://www.amazon.com", "https://www.google.com", diff --git a/Passepartout/Sources/Model/TransientStore.swift b/Passepartout/Sources/Model/TransientStore.swift index 6b31f1ab..225fa450 100644 --- a/Passepartout/Sources/Model/TransientStore.swift +++ b/Passepartout/Sources/Model/TransientStore.swift @@ -56,7 +56,7 @@ public class TransientStore { // this must be graceful ConnectionService.migrateJSON(from: TransientStore.serviceURL, to: TransientStore.serviceURL) - let cfg = AppConstants.VPN.baseConfiguration() + let cfg = AppConstants.VPN.baseConfiguration.build() do { let data = try Data(contentsOf: TransientStore.serviceURL) if let content = String(data: data, encoding: .utf8) {