aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-06-28 08:00:42 +0200
committerChristof Rabensteiner <christof.rabensteiner@iaik.tugraz.at>2019-06-28 08:00:42 +0200
commit52306ddf6e786bd1ceaba09cbe37b42778b715fe (patch)
treed14f4528214ceaa5d6920be907b07d500ed08086 /src/main/java
parenta9a9e1cb62123475edd733a53ecc00611c2aa764 (diff)
downloadmoa-zs-52306ddf6e786bd1ceaba09cbe37b42778b715fe.tar.gz
moa-zs-52306ddf6e786bd1ceaba09cbe37b42778b715fe.tar.bz2
moa-zs-52306ddf6e786bd1ceaba09cbe37b42778b715fe.zip
Simplified Config Validation
- Also: Ensure that truststore is of type JKS because PKCS12 is not supported.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java b/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java
index 14fb377..6c9d264 100644
--- a/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java
+++ b/src/main/java/at/gv/egiz/moazs/preprocess/ConfigUtil.java
@@ -229,13 +229,11 @@ public class ConfigUtil {
}
private boolean isTVNZClientConfigured(ClientType tnvzClient, Boolean isPerformQueryPersonRequest) {
- return (isPerformQueryPersonRequest
- && tnvzClient != null
- && tnvzClient.getURL() != null
- && tnvzClient.getReceiveTimeout() != null
- && tnvzClient.getConnectionTimeout() != null
- && isSSLConfigured(tnvzClient))
- || !isPerformQueryPersonRequest;
+ return !isPerformQueryPersonRequest || (tnvzClient != null
+ && tnvzClient.getURL() != null
+ && tnvzClient.getReceiveTimeout() != null
+ && tnvzClient.getConnectionTimeout() != null
+ && isSSLConfigured(tnvzClient));
}
private boolean isMSGClientConfigured(ClientType msgClientParams) {
@@ -247,21 +245,23 @@ public class ConfigUtil {
}
private boolean isSSLConfigured(ClientType clientParams) {
- return (clientParams.getURL().startsWith("https")
- && clientParams.getSSL() != null
+ return !clientParams.getURL().startsWith("https") || (clientParams.getSSL() != null
&& clientParams.getSSL().isTrustAll() != null
&& clientParams.getSSL().isLaxHostNameVerification() != null
&& isKeyStoreConfigured(clientParams.getSSL().getKeyStore())
- && isKeyStoreConfigured(clientParams.getSSL().getTrustStore()))
- || !clientParams.getURL().startsWith("https");
+ && isTrustStoreConfigured(clientParams.getSSL().getTrustStore()));
}
private boolean isKeyStoreConfigured(KeyStoreType keyStore) {
- return (keyStore != null
- && keyStore.getPassword() != null
+ return keyStore == null || (keyStore.getPassword() != null
&& keyStore.getFileType() != null
- && keyStore.getFileName() != null)
- || keyStore == null;
+ && keyStore.getFileName() != null);
+ }
+
+ private boolean isTrustStoreConfigured(KeyStoreType trustStore) {
+ return trustStore == null || (trustStore.getPassword() != null
+ && "JKS".equals(trustStore.getFileType())
+ && trustStore.getFileName() != null);
}