@Test(expected = IOException.class)
public void connectionFailsWithoutValidServerCertificate() throws IOException, StoreConfigurationException {
TrustStoreConfiguration tsc = new TrustStoreConfiguration(TestConstants.TRUSTSTORE_FILE, null, null, null);
SslConfiguration sc = SslConfiguration.createSSLConfiguration(null, null, tsc);
SSLSocketFactory factory = sc.getSslSocketFactory();
SSLSocket clientSocket = (SSLSocket) factory.createSocket(TLS_TEST_HOST, TLS_TEST_PORT);
OutputStream os = clientSocket.getOutputStream();
os.write("GET config/login_verify2?".getBytes());
Assert.assertTrue(false);
}