aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/at/gv/egiz/moazs/preprocess
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/at/gv/egiz/moazs/preprocess')
-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);
}