liugddx commented on issue #8583:
URL: https://github.com/apache/seatunnel/issues/8583#issuecomment-2611340120

   This is a demo
   
   
   ```
   import org.eclipse.jetty.server.Server;
   import org.eclipse.jetty.server.ServerConnector;
   import org.eclipse.jetty.util.ssl.SslContextFactory;
   
   import java.io.File;
   
   public class JettyServer {
       public static void main(String[] args) throws Exception {
           Server server = new Server();
   
           ServerConnector httpConnector = new ServerConnector(server);
           httpConnector.setPort(8080);
           server.addConnector(httpConnector);
   
           String keystorePath = "/path/to/keystore.jks";
           String keystorePassword = "your_keystore_password";
           String keyManagerPassword = "your_key_password";
   
           File keystoreFile = new File(keystorePath);
           if (keystoreFile.exists() && keystoreFile.isFile()) {
   
               SslContextFactory.Server sslContextFactory = new 
SslContextFactory.Server();
               sslContextFactory.setKeyStorePath(keystorePath);
               sslContextFactory.setKeyStorePassword(keystorePassword);
               sslContextFactory.setKeyManagerPassword(keyManagerPassword);
   
               ServerConnector httpsConnector = new ServerConnector(server, 
sslContextFactory);
               httpsConnector.setPort(8443);
               server.addConnector(httpsConnector);
           } else {
               System.out.println("No HTTPS configuration detected, falling 
back to HTTP...");
           }
   
           server.setHandler(...);
   
           server.start();
           server.join();
       }
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@seatunnel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to