@Test public void createTrustSource() throws Exception { KeystoreData keystoreData = BmpTests.generateKeystoreForUnitTest(null); TrustSource trustSource = NanohttpdTlsEndpointFactory.createTrustSource(keystoreData); assertNotNull("trustSource", trustSource); int numTrustedCAs = trustSource.getTrustedCAs().length; assertTrue("more than one trusted CA", numTrustedCAs > 1); }
@SuppressWarnings("RedundantThrows") public static TrustSource createTrustSource(KeystoreData keystoreData) throws IOException, GeneralSecurityException { return TrustSource.defaultTrustSource() .add(keystoreData.asCertificateAndKeySource().load().getCertificate()); }
NanohttpdTlsEndpointFactory implements TlsEndpointFactory { @SuppressWarnings("RedundantThrows") public static TrustSource createTrustSource(KeystoreData keystoreData) throws IOException, GeneralSecurityException { return TrustSource.defaultTrustSource() .add(keystoreData.asCertificateAndKeySource().load().getCertificate()); } }
NanohttpdTlsEndpointFactory implements TlsEndpointFactory { @SuppressWarnings("RedundantThrows") public static TrustSource createTrustSource(KeystoreData keystoreData) throws IOException, GeneralSecurityException { return TrustSource.defaultTrustSource() .add(keystoreData.asCertificateAndKeySource().load().getCertificate()); } NanohttpdTlsEndpointFactory(SSLServerSocketFactory socketFactory, TrustSource trustSource, @Nullable Integer port); }
NanohttpdTlsEndpointFactory implements TlsEndpointFactory { @SuppressWarnings("RedundantThrows") public static TrustSource createTrustSource(KeystoreData keystoreData) throws IOException, GeneralSecurityException { return TrustSource.defaultTrustSource() .add(keystoreData.asCertificateAndKeySource().load().getCertificate()); } NanohttpdTlsEndpointFactory(SSLServerSocketFactory socketFactory, TrustSource trustSource, @Nullable Integer port); @Override TlsEndpoint produce(BrowsermobVhsConfig config, Path scratchDir); static NanohttpdTlsEndpointFactory create(KeystoreData keystoreData, @Nullable Integer port); static SSLServerSocketFactory createSSLServerSocketFactory(KeystoreData keystoreData); @SuppressWarnings("RedundantThrows") static TrustSource createTrustSource(KeystoreData keystoreData); }
NanohttpdTlsEndpointFactory implements TlsEndpointFactory { @SuppressWarnings("RedundantThrows") public static TrustSource createTrustSource(KeystoreData keystoreData) throws IOException, GeneralSecurityException { return TrustSource.defaultTrustSource() .add(keystoreData.asCertificateAndKeySource().load().getCertificate()); } NanohttpdTlsEndpointFactory(SSLServerSocketFactory socketFactory, TrustSource trustSource, @Nullable Integer port); @Override TlsEndpoint produce(BrowsermobVhsConfig config, Path scratchDir); static NanohttpdTlsEndpointFactory create(KeystoreData keystoreData, @Nullable Integer port); static SSLServerSocketFactory createSSLServerSocketFactory(KeystoreData keystoreData); @SuppressWarnings("RedundantThrows") static TrustSource createTrustSource(KeystoreData keystoreData);  }