diff --git a/MoppApp/MoppApp/Configuration.swift b/MoppApp/MoppApp/Configuration.swift index 2af892862..942d8e9ca 100644 --- a/MoppApp/MoppApp/Configuration.swift +++ b/MoppApp/MoppApp/Configuration.swift @@ -26,6 +26,7 @@ import Foundation internal struct MOPPConfiguration: Codable { let MIDSIGNURL: String + var TSLURL: String let SIVAURL: String let METAINF: MOPPMetaInf let TSAURL: String @@ -36,6 +37,7 @@ internal struct MOPPConfiguration: Codable { private enum MOPPConfigurationType: String, CodingKey { case MIDSIGNURL = "MID-SIGN-URL" + case TSLURL = "TSL-URL" case SIVAURL = "SIVA-URL" case METAINF = "META-INF" case TSAURL = "TSA-URL" @@ -48,6 +50,7 @@ internal struct MOPPConfiguration: Codable { init(from decoder: Decoder) throws { let container = try decoder.container(keyedBy: MOPPConfigurationType.self) MIDSIGNURL = try container.decode(String.self, forKey: .MIDSIGNURL) + TSLURL = try container.decode(String.self, forKey: .TSLURL) SIVAURL = try container.decode(String.self, forKey: .SIVAURL) METAINF = try container.decode(MOPPMetaInf.self, forKey: .METAINF) TSAURL = try container.decode(String.self, forKey: .TSAURL) diff --git a/MoppApp/MoppApp/DiagnosticsViewController.swift b/MoppApp/MoppApp/DiagnosticsViewController.swift index 295f463f4..8252ca4ce 100644 --- a/MoppApp/MoppApp/DiagnosticsViewController.swift +++ b/MoppApp/MoppApp/DiagnosticsViewController.swift @@ -95,7 +95,7 @@ class DiagnosticsViewController: MoppViewController { let decodedConf = getMoppConfiguration() configURL.text = formatString(text: "CONFIG_URL:", additionalText: decodedConf.METAINF.URL) - tslURL.text = formatString(text: "TSL_URL:", additionalText: SettingsConfiguration().getDefaultMoppConfiguration().TSLURL) + tslURL.text = formatString(text: "TSL_URL:", additionalText: getMoppConfiguration().TSLURL) sivaURL.text = formatString(text: "SIVA_URL:", additionalText: decodedConf.SIVAURL) tsaURL.text = formatString(text: "TSA_URL:", additionalText: decodedConf.TSAURL) midSignURL.text = formatString(text: "MID-SIGN-URL:", additionalText: decodedConf.MIDSIGNURL) diff --git a/MoppApp/MoppApp/SettingsConfiguration.swift b/MoppApp/MoppApp/SettingsConfiguration.swift index 22a1dc7b1..6a777b07a 100644 --- a/MoppApp/MoppApp/SettingsConfiguration.swift +++ b/MoppApp/MoppApp/SettingsConfiguration.swift @@ -93,7 +93,7 @@ class SettingsConfiguration: NSObject, URLSessionDelegate, URLSessionTaskDelegat setAllConfigurationToCache(configData: localConfigData, signature: localSignature, initialUpdateDate: MoppDateFormatter().stringToDate(dateString: getDefaultMoppConfiguration().UPDATEDATE), versionSerial: decodedData.METAINF.SERIAL) setConfigurationToCache("", forKey: "lastUpdateDateCheck") - setupMoppConfiguration(sivaUrl: decodedData.SIVAURL, tslUrl: getDefaultMoppConfiguration().TSLURL, tslCerts: decodedData.TSLCERTS, tsaUrl: decodedData.TSAURL, ocspIssuers: decodedData.OCSPISSUERS) + setupMoppConfiguration(sivaUrl: decodedData.SIVAURL, tslUrl: decodedData.TSLURL, tslCerts: decodedData.TSLCERTS, tsaUrl: decodedData.TSAURL, ocspIssuers: decodedData.OCSPISSUERS) setupMoppLDAPConfiguration(ldapPersonUrl: decodedData.LDAPPERSONURL, ldapCorpUrl: decodedData.LDAPCORPURL) setMoppConfiguration(configuration: decodedData) @@ -113,7 +113,8 @@ class SettingsConfiguration: NSObject, URLSessionDelegate, URLSessionTaskDelegat _ = try SignatureVerifier().isSignatureCorrect(configData: trim(text: cachedConfigData)!, publicKey: localPublicKey, signature: cachedSignature) let decodedData = try MoppConfigurationDecoder().decodeMoppConfiguration(configData: cachedConfigData) - setupMoppConfiguration(sivaUrl: decodedData.SIVAURL, tslUrl: getDefaultMoppConfiguration().TSLURL, tslCerts: decodedData.TSLCERTS, tsaUrl: decodedData.TSAURL, ocspIssuers: decodedData.OCSPISSUERS) + setupMoppConfiguration(sivaUrl: decodedData.SIVAURL, tslUrl: decodedData.TSLURL, tslCerts: decodedData.TSLCERTS, tsaUrl: decodedData.TSAURL, ocspIssuers: decodedData.OCSPISSUERS) + setupMoppLDAPConfiguration(ldapPersonUrl: decodedData.LDAPPERSONURL, ldapCorpUrl: decodedData.LDAPCORPURL) setMoppConfiguration(configuration: decodedData) @@ -139,6 +140,8 @@ class SettingsConfiguration: NSObject, URLSessionDelegate, URLSessionTaskDelegat setMoppConfiguration(configuration: decodedData) + setupMoppConfiguration(sivaUrl: decodedData.SIVAURL, tslUrl: decodedData.TSLURL, tslCerts: decodedData.TSLCERTS, tsaUrl: decodedData.TSAURL, ocspIssuers: decodedData.OCSPISSUERS) + reloadDigiDocConf() } else {