Issue #1787 Improved XmlConfiguration setter exception

This commit is contained in:
Greg Wilkins 2017-09-04 15:02:17 +10:00
parent 9285adb596
commit eec6453daa
1 changed files with 23 additions and 0 deletions

View File

@ -20,6 +20,12 @@ package org.eclipse.jetty.embedded;
import java.io.File; import java.io.File;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.lang.reflect.Method;
import java.security.Provider;
import java.security.Security;
import java.util.function.BiFunction;
import javax.net.ssl.SSLEngine;
import org.eclipse.jetty.http.HttpVersion; import org.eclipse.jetty.http.HttpVersion;
import org.eclipse.jetty.server.Connector; import org.eclipse.jetty.server.Connector;
@ -84,10 +90,14 @@ public class ManyConnectors
// to know about. Much more configuration is available the ssl context, // to know about. Much more configuration is available the ssl context,
// including things like choosing the particular certificate out of a // including things like choosing the particular certificate out of a
// keystore to be used. // keystore to be used.
Security.addProvider((Provider)ClassLoader.getSystemClassLoader().loadClass("org.conscrypt.OpenSSLProvider").newInstance());
SslContextFactory sslContextFactory = new SslContextFactory(); SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStorePath(keystoreFile.getAbsolutePath()); sslContextFactory.setKeyStorePath(keystoreFile.getAbsolutePath());
sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4"); sslContextFactory.setKeyStorePassword("OBF:1vny1zlo1x8e1vnw1vn61x8g1zlu1vn4");
sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g"); sslContextFactory.setKeyManagerPassword("OBF:1u2u1wml1z7s1z7a1wnl1u2g");
sslContextFactory.setProvider("Conscrypt");
// HTTPS Configuration // HTTPS Configuration
// A new HttpConfiguration object is needed for the next connector and // A new HttpConfiguration object is needed for the next connector and
@ -126,6 +136,19 @@ public class ManyConnectors
// Start the server // Start the server
server.start(); server.start();
SSLEngine engine = sslContextFactory.newSSLEngine();
System.err.println(engine);
System.err.println(engine.getClass());
for (Method m : engine.getClass().getMethods())
{
System.err.println(m);
}
server.join(); server.join();
} }
} }