@BeforeClass public static void setUp() throws Throwable { // Force a custom trust store... that shouldn't override the Java default cacerts. URI customStore = ServerX509TrustManagerTest.class .getResource("/certs/trusted_certificates.jks").toURI(); File f = new File(customStore.getPath()); originalTrustStoreProp = System.setProperty(JAVAX_NET_SSL_TRUST_STORE, f.getPath()); originalTrustStorePasswordProp = System.setProperty(JAVAX_NET_SSL_TRUST_STORE_PASSWORD, "changeit"); // Fake host, not really needed for the purpose of the trust manager test. ServiceHost host = new ServiceHost() { }; ServerX509TrustManager.invalidate(); trustManager = ServerX509TrustManager.init(host); }