flink-instrumentation/workspace/flink-1.4.1-instrumented/flink-1.4.1/flink-runtime/src/test/java/org/apache/flink/runtime/net/SSLUtilsTest.java
/**
	 * Tests if SSL Client Context creation fails with bad SSL configuration.
	 */
Tests if SSL Client Context creation fails with bad SSL configuration.
Tests if SSL Client Context creation fails with bad SSL configuration .
@Test
	public void testCreateSSLClientContextMisconfiguration() {
		Configuration clientConfig = new Configuration();
		clientConfig.setBoolean(SecurityOptions.SSL_ENABLED, true);
		clientConfig.setString(SecurityOptions.SSL_TRUSTSTORE, "src/test/resources/local127.truststore");
		clientConfig.setString(SecurityOptions.SSL_TRUSTSTORE_PASSWORD, "badpassword");
		try {
			SSLContext clientContext = SSLUtils.createSSLClientContext(clientConfig);
			Assert.fail("SSL client context created even with bad SSL configuration ");
		} catch (Exception e) {
		}
	}
@ Test public void testCreateSSLClientContextMisconfiguration ( ) { Configuration clientConfig = new Configuration ( ) ; clientConfig . setBoolean ( SecurityOptions . SSL_ENABLED , true ) ; clientConfig . setString ( SecurityOptions . SSL_TRUSTSTORE , "src/test/resources/local127.truststore" ) ; clientConfig . setString ( SecurityOptions . SSL_TRUSTSTORE_PASSWORD , "badpassword" ) ; try { SSLContext clientContext = SSLUtils . createSSLClientContext ( clientConfig ) ; Assert . fail ( "SSL client context created even with bad SSL configuration " ) ; } catch ( Exception e ) { } }
Tests if SSL Client Context creation fails with bad SSL configuration.
Tests if SSL Client Context creation fails with bad SSL configuration .
// Exception here is valid