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 Server Context creation fails with bad SSL configuration.
	 */
Tests if SSL Server Context creation fails with bad SSL configuration.
Tests if SSL Server Context creation fails with bad SSL configuration .
@Test
	public void testCreateSSLServerContextWithMultiProtocols() {
		Configuration serverConfig = new Configuration();
		serverConfig.setBoolean(SecurityOptions.SSL_ENABLED, true);
		serverConfig.setString(SecurityOptions.SSL_KEYSTORE, "src/test/resources/local127.keystore");
		serverConfig.setString(SecurityOptions.SSL_KEYSTORE_PASSWORD, "password");
		serverConfig.setString(SecurityOptions.SSL_KEY_PASSWORD, "password");
		serverConfig.setString(SecurityOptions.SSL_PROTOCOL, "TLSv1,TLSv1.2");
		try {
			SSLContext serverContext = SSLUtils.createSSLServerContext(serverConfig);
			Assert.fail("SSL server context created even with multiple protocols set ");
		} catch (Exception e) {
		}
	}
@ Test public void testCreateSSLServerContextWithMultiProtocols ( ) { Configuration serverConfig = new Configuration ( ) ; serverConfig . setBoolean ( SecurityOptions . SSL_ENABLED , true ) ; serverConfig . setString ( SecurityOptions . SSL_KEYSTORE , "src/test/resources/local127.keystore" ) ; serverConfig . setString ( SecurityOptions . SSL_KEYSTORE_PASSWORD , "password" ) ; serverConfig . setString ( SecurityOptions . SSL_KEY_PASSWORD , "password" ) ; serverConfig . setString ( SecurityOptions . SSL_PROTOCOL , "TLSv1,TLSv1.2" ) ; try { SSLContext serverContext = SSLUtils . createSSLServerContext ( serverConfig ) ; Assert . fail ( "SSL server context created even with multiple protocols set " ) ; } catch ( Exception e ) { } }
Tests if SSL Server Context creation fails with bad SSL configuration.
Tests if SSL Server Context creation fails with bad SSL configuration .
// Exception here is valid