flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fhue...@apache.org
Subject [36/37] flink git commit: [FLINK-4848] [ssl] Throw meaningful exception when SSL is misconfigured
Date Thu, 06 Apr 2017 07:28:49 GMT
[FLINK-4848] [ssl] Throw meaningful exception when SSL is misconfigured

This closes #3677.


Project: http://git-wip-us.apache.org/repos/asf/flink/repo
Commit: http://git-wip-us.apache.org/repos/asf/flink/commit/80800d8c
Tree: http://git-wip-us.apache.org/repos/asf/flink/tree/80800d8c
Diff: http://git-wip-us.apache.org/repos/asf/flink/diff/80800d8c

Branch: refs/heads/table-retraction
Commit: 80800d8cecee2d20add674bb2a74cd2065b52cf8
Parents: cf28a56
Author: zentol <chesnay@apache.org>
Authored: Wed Apr 5 23:23:40 2017 +0200
Committer: zentol <chesnay@apache.org>
Committed: Thu Apr 6 07:34:46 2017 +0200

----------------------------------------------------------------------
 .../src/main/java/org/apache/flink/runtime/net/SSLUtils.java  | 7 +++++++
 1 file changed, 7 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/80800d8c/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java
----------------------------------------------------------------------
diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java b/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java
index c2d7a7b..5bafeb8 100644
--- a/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java
+++ b/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java
@@ -141,6 +141,9 @@ public class SSLUtils {
 				ConfigConstants.SECURITY_SSL_PROTOCOL,
 				ConfigConstants.DEFAULT_SECURITY_SSL_PROTOCOL);
 
+			Preconditions.checkNotNull(trustStoreFilePath, ConfigConstants.SECURITY_SSL_TRUSTSTORE
+ " was not configured.");
+			Preconditions.checkNotNull(trustStorePassword, ConfigConstants.SECURITY_SSL_TRUSTSTORE_PASSWORD
+ " was not configured.");
+
 			KeyStore trustStore = KeyStore.getInstance(KeyStore.getDefaultType());
 
 			FileInputStream trustStoreFile = null;
@@ -198,6 +201,10 @@ public class SSLUtils {
 				ConfigConstants.SECURITY_SSL_PROTOCOL,
 				ConfigConstants.DEFAULT_SECURITY_SSL_PROTOCOL);
 
+			Preconditions.checkNotNull(keystoreFilePath, ConfigConstants.SECURITY_SSL_KEYSTORE + "
was not configured.");
+			Preconditions.checkNotNull(keystorePassword, ConfigConstants.SECURITY_SSL_KEYSTORE_PASSWORD
+ " was not configured.");
+			Preconditions.checkNotNull(certPassword, ConfigConstants.SECURITY_SSL_KEY_PASSWORD + "
was not configured.");
+
 			KeyStore ks = KeyStore.getInstance(KeyStore.getDefaultType());
 			FileInputStream keyStoreFile = null;
 			try {


Mime
View raw message