From: Dave B. <bla...@us...> - 2012-09-13 12:01:58
|
Update of /cvsroot/sblim/jsr48-client/utst/org/sblim/cimclient/unittest/http In directory vz-cvs-3.sog:/tmp/cvs-serv17692/utst/org/sblim/cimclient/unittest/http Modified Files: Tag: Experimental SSLConfigurationTest.java Log Message: 2.2.0 release work (format) Index: SSLConfigurationTest.java =================================================================== RCS file: /cvsroot/sblim/jsr48-client/utst/org/sblim/cimclient/unittest/http/SSLConfigurationTest.java,v retrieving revision 1.1.2.12 retrieving revision 1.1.2.13 diff -u -d -r1.1.2.12 -r1.1.2.13 --- SSLConfigurationTest.java 27 Aug 2012 21:52:21 -0000 1.1.2.12 +++ SSLConfigurationTest.java 13 Sep 2012 12:01:56 -0000 1.1.2.13 @@ -80,15 +80,15 @@ System.setProperty(WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION, "ignore"); // PEER VERIFICATION disabled globally (should PASS) - connect(WBEMConfiguration.getGlobalConfiguration(), - WBEMConfiguration.getGlobalConfiguration()); + connect(WBEMConfiguration.getGlobalConfiguration(), WBEMConfiguration + .getGlobalConfiguration()); // PEER VERIFICATION disabled but truststore configured (should PASS and // give WARNING) System.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, "/any/path/even/if/not/validated"); - connect(WBEMConfiguration.getGlobalConfiguration(), - WBEMConfiguration.getGlobalConfiguration()); + connect(WBEMConfiguration.getGlobalConfiguration(), WBEMConfiguration + .getGlobalConfiguration()); // CLIENT_PEER_VERIFICATION enabled globally but no truststore // configured (should FAIL) @@ -96,8 +96,8 @@ System.setProperty(WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION, "ignore"); System.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, ""); try { - connect(WBEMConfiguration.getGlobalConfiguration(), - WBEMConfiguration.getGlobalConfiguration()); + connect(WBEMConfiguration.getGlobalConfiguration(), WBEMConfiguration + .getGlobalConfiguration()); fail("Connection established with client peer verification enabled but no truststore configured"); } catch (Exception e) { // expected to fail @@ -107,8 +107,8 @@ System.setProperty(WBEMConfigurationProperties.SSL_CLIENT_PEER_VERIFICATION, "false"); System.setProperty(WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION, "require"); try { - connect(WBEMConfiguration.getGlobalConfiguration(), - WBEMConfiguration.getGlobalConfiguration()); + connect(WBEMConfiguration.getGlobalConfiguration(), WBEMConfiguration + .getGlobalConfiguration()); fail("Connection established with listener peer verification enabled but no truststore configured (n)"); } catch (Exception e) { // expected to fail @@ -119,8 +119,8 @@ System.setProperty(WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION, "ignore"); System.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, "somebadpath"); try { - connect(WBEMConfiguration.getGlobalConfiguration(), - WBEMConfiguration.getGlobalConfiguration()); + connect(WBEMConfiguration.getGlobalConfiguration(), WBEMConfiguration + .getGlobalConfiguration()); fail("Connection established with client peer verification enabled but truststore misconfigured"); } catch (Exception e) { // expected to fail @@ -131,8 +131,8 @@ System.setProperty(WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION, "require"); System.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, "somebadpath"); try { - connect(WBEMConfiguration.getGlobalConfiguration(), - WBEMConfiguration.getGlobalConfiguration()); + connect(WBEMConfiguration.getGlobalConfiguration(), WBEMConfiguration + .getGlobalConfiguration()); fail("Connection established with listener peer verification enabled but truststore misconfigured"); } catch (Exception e) { // expected to fail @@ -159,8 +159,8 @@ Properties clientConfiguration = new Properties(); Properties serverConfiguration = new Properties(); - serverConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, - keystore.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, keystore + .getFile()); serverConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PASSWORD, "password"); serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, ""); serverConfiguration @@ -212,15 +212,15 @@ } // CLIENT_PEER_VERIFICATION enabled at domain-level with valid // truststore (should PASS) - clientConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - truststore.getFile()); + clientConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, truststore + .getFile()); connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); // CLIENT_PEER_VERIFICATION enabled at domain-level with notrust // truststore (should FAIL) - clientConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - notrust.getFile()); + clientConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, notrust + .getFile()); try { connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); @@ -230,10 +230,10 @@ } // CLIENT_PEER_VERIFICATION enabled at domain-level with untrusted // server keystore (should FAIL) - clientConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - truststore.getFile()); - serverConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, - stranger.getFile()); + clientConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, truststore + .getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, stranger + .getFile()); try { connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); @@ -263,14 +263,14 @@ Properties clientConfiguration = new Properties(); Properties serverConfiguration = new Properties(); - serverConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, - keystore.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, keystore + .getFile()); serverConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PASSWORD, "password"); serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, ""); serverConfiguration .setProperty(WBEMConfigurationProperties.TRUSTSTORE_PASSWORD, "password"); - clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, - keystore.getFile()); + clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, keystore + .getFile()); clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PASSWORD, "password"); clientConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, ""); clientConfiguration @@ -317,15 +317,15 @@ } // LISTENER_PEER_VERIFICATION enabled at domain-level with valid // truststore (should PASS) - serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - truststore.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, truststore + .getFile()); connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); // LISTENER_PEER_VERIFICATION enabled at domain-level with notrust // truststore (should FAIL) - serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - notrust.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, notrust + .getFile()); try { connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); @@ -335,10 +335,10 @@ } // LISTENER_PEER_VERIFICATION enabled at domain-level with untrusted // client keystore (should FAIL) - serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - truststore.getFile()); - clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, - stranger.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, truststore + .getFile()); + clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, stranger + .getFile()); try { connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); @@ -348,8 +348,8 @@ } // LISTENER_PEER_VERIFICATION enabled at domain-level but no client // keystore (should FAIL) - serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - truststore.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, truststore + .getFile()); clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, ""); try { connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( @@ -362,10 +362,10 @@ // (should PASS) serverConfiguration.setProperty(WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION, "accept"); - serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - truststore.getFile()); - clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, - keystore.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, truststore + .getFile()); + clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, keystore + .getFile()); connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); @@ -373,10 +373,10 @@ // keystore (should PASS) serverConfiguration.setProperty(WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION, "accept"); - serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - truststore.getFile()); - clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, - stranger.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, truststore + .getFile()); + clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, stranger + .getFile()); connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); @@ -384,8 +384,8 @@ // (should PASS) serverConfiguration.setProperty(WBEMConfigurationProperties.SSL_LISTENER_PEER_VERIFICATION, "accept"); - serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, - truststore.getFile()); + serverConfiguration.setProperty(WBEMConfigurationProperties.TRUSTSTORE_PATH, truststore + .getFile()); clientConfiguration.setProperty(WBEMConfigurationProperties.KEYSTORE_PATH, ""); connect(new WBEMConfiguration(clientConfiguration), new WBEMConfiguration( serverConfiguration)); @@ -830,8 +830,8 @@ */ private int startServer(final WBEMConfiguration pConfiguration) throws IOException, InterruptedException { - final ServerSocket socket = HttpSocketFactory.getInstance() - .getServerSSLContext(pConfiguration).getServerSocketFactory().createServerSocket(0); + final ServerSocket socket = HttpSocketFactory.getInstance().getServerSSLContext( + pConfiguration).getServerSocketFactory().createServerSocket(0); if (pConfiguration.getSslListenerPeerVerification().equalsIgnoreCase("ignore")) { ((SSLServerSocket) socket).setNeedClientAuth(false); |