Cleaned up examples for #1830.

This commit is contained in:
WalkerWatch 2017-11-22 13:39:23 -05:00
parent d285c718b9
commit 9e891a4ceb
2 changed files with 3 additions and 3 deletions

View File

@ -20,9 +20,9 @@ package org.eclipse.jetty.embedded;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.security.Provider;
import java.security.Security; import java.security.Security;
import org.conscrypt.OpenSSLProvider;
import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Connector;
import org.eclipse.jetty.server.HttpConfiguration; import org.eclipse.jetty.server.HttpConfiguration;
@ -97,7 +97,7 @@ public class ManyConnectors
// OPTIONAL: Un-comment the following to use Conscrypt for SSL instead of // OPTIONAL: Un-comment the following to use Conscrypt for SSL instead of
// the native JSSE implementation. // the native JSSE implementation.
//Security.addProvider((Provider)ClassLoader.getSystemClassLoader().loadClass("org.conscrypt.OpenSSLProvider").newInstance()); //Security.addProvider(new OpenSSLProvider());
//sslContextFactory.setProvider("Conscrypt"); //sslContextFactory.setProvider("Conscrypt");
// HTTPS Configuration // HTTPS Configuration

View File

@ -724,7 +724,7 @@ Implementing Conscrypt is very straightforward process - simply instantiate an i
[source, java, subs="{sub-order}"] [source, java, subs="{sub-order}"]
---- ----
... ...
Security.addProvider((Provider)ClassLoader.getSystemClassLoader().loadClass("org.conscrypt.OpenSSLProvider").newInstance()); Security.addProvider(new OpenSSLProvider());
... ...
SslContextFactory sslContextFactory = new SslContextFactory(); SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStorePath("path/to/keystore"); sslContextFactory.setKeyStorePath("path/to/keystore");