使用此代码:
import org.eclipse.jetty.server.*;
import org.eclipse.jetty.util.ssl.*;
import org.eclipse.jetty.util.log.*;
public class JettySSLFailure {
public static void main(String[] args) throws Exception {
Log.getRootLogger().setDebugEnabled(true);
Server server = new Server();
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStorePath("trajan.jks");
sslContextFactory.setKeyStoreType("JCEKS");
sslContextFactory.setKeyStorePassword("welcome1");
sslContextFactory.setCertAlias("trajanssl");
sslContextFactory.setKeyManagerPassword("welcome1");
SslConnectionFactory sslConnectionFactory =
new SslConnectionFactory(
sslContextFactory, "http/1.1");
HttpConfiguration sslHttpConfig = new HttpConfiguration();
HttpConnectionFactory httpConnectionFactory =
new HttpConnectionFactory(sslHttpConfig);
ServerConnector serverConnector =
new ServerConnector(server, sslConnectionFactory,
httpConnectionFactory);
serverConnector.setPort(9999);
server.addConnector(serverConnector);
server.start();
}
}
此密钥库https://sites.google.com/site/skissane/files/trajan.jks
这些JAR:javax.servlet-3.0.0.v201112011016.jar jetty-http-9.0.4.v20130625.jar jetty-io-9.0.4.v20130625.jar jetty-server-9.0.4.v20130625。 jar jetty-util-9.0.4.v20130625.jar
任何SSL连接尝试都会导致记录: javax.net.ssl.SSLHandshakeException:没有共同的密码套件
任何人都知道我做错了什么?