我使用嵌入式Jetty服务器并使用https创建了一个Rest API,以确保安全。 我们正在使用客户端特定的JRE来运行API。当我在使用Firefox浏览器的https上访问API时,出现以下错误:
无法与对等方安全地通信:没有通用的加密算法。错误代码:SSL_ERROR_NO_CYPHER_OVERLAP
但是,当我更改JRE并使用常用的JRE时,它将开始正常工作。两个JRE的版本相同,即1.8
HttpConfiguration https = new HttpConfiguration();
https.addCustomizer(new SecureRequestCustomizer());
SslContextFactory sslContextFactory = new SslContextFactory();
sslContextFactory.setKeyStore(keyStore);
sslContextFactory.setKeyStorePassword("changeit");
sslContextFactory.setKeyManagerPassword("changeit");
sslContextFactory.setCertAlias("selfsignlatest");
sslContextFactory.setNeedClientAuth(true);
sslContextFactory.setTrustStore(keyStore);
sslContextFactory.setTrustStorePassword("changeit");
ServerConnector sslConnector = new ServerConnector(server,
new SslConnectionFactory(sslContextFactory, "http/1.1"),
new HttpConnectionFactory(https));
sslConnector.setPort(9008);
//----Setting connectors in server--------------
server.setConnectors(new Connector[] { connector, sslConnector});