2121import org .apache .iotdb .externalservice .api .IExternalService ;
2222import org .apache .iotdb .rest .i18n .RestMessages ;
2323import org .apache .iotdb .rest .protocol .filter .ApiOriginFilter ;
24+ import org .apache .iotdb .rpc .RpcSslUtils ;
2425
2526import org .eclipse .jetty .ee10 .servlet .ServletContextHandler ;
2627import org .eclipse .jetty .ee10 .servlet .ServletHolder ;
@@ -52,6 +53,7 @@ private void startSSL(
5253 String trustStorePath ,
5354 String keyStorePwd ,
5455 String trustStorePwd ,
56+ String sslProtocol ,
5557 int idleTime ,
5658 boolean clientAuth ) {
5759 server = new Server ();
@@ -61,6 +63,7 @@ private void startSSL(
6163 httpsConfig .addCustomizer (new SecureRequestCustomizer ());
6264
6365 SslContextFactory .Server sslContextFactory = new SslContextFactory .Server ();
66+ configureSSL (sslContextFactory , sslProtocol );
6467 sslContextFactory .setKeyStorePath (keyStorePath );
6568 sslContextFactory .setKeyStorePassword (keyStorePwd );
6669 if (clientAuth ) {
@@ -125,6 +128,7 @@ public void start() {
125128 config .getTrustStorePath (),
126129 config .getKeyStorePwd (),
127130 config .getTrustStorePwd (),
131+ config .getSslProtocol (),
128132 config .getIdleTimeoutInSeconds (),
129133 config .isClientAuth ());
130134 } else {
@@ -142,4 +146,9 @@ public void stop() {
142146 server .destroy ();
143147 }
144148 }
149+
150+ private void configureSSL (SslContextFactory .Server sslContextFactory , String sslProtocol ) {
151+ String protocol = RpcSslUtils .normalizeProtocol (sslProtocol );
152+ sslContextFactory .setProtocol (protocol );
153+ }
145154}
0 commit comments