Skip to content

Commit 444bd83

Browse files
authored
Disable SNI checks for HTTPS (#1215)
Disable SNI checks for HTTPS Closes #1214
1 parent 2ff0b88 commit 444bd83

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/qz/ws/PrintSocketServer.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,14 @@ private static Server findAvailableSecurePort(CertificateManager certManager) {
144144
try {
145145
// Bind the secure socket on the proper port number (i.e. 8181), add it as an additional connector
146146
SslConnectionFactory sslConnection = new SslConnectionFactory(certManager.configureSslContextFactory(), HttpVersion.HTTP_1_1.asString());
147-
HttpConnectionFactory httpConnection = new HttpConnectionFactory(new HttpConfiguration());
147+
148+
// Disable SNI checks for easier print-server testing (replicates Jetty 9.x behavior)
149+
HttpConfiguration httpsConfig = new HttpConfiguration();
150+
SecureRequestCustomizer customizer = new SecureRequestCustomizer();
151+
customizer.setSniHostCheck(false);
152+
httpsConfig.addCustomizer(customizer);
153+
154+
HttpConnectionFactory httpConnection = new HttpConnectionFactory(httpsConfig);
148155

149156
ServerConnector secureConnector = new ServerConnector(server, sslConnection, httpConnection);
150157
secureConnector.setHost(certManager.getProperties().getProperty("wss.host"));

0 commit comments

Comments
 (0)