Jetty SslConnector's deprecated methods

后端 未结 2 1550
名媛妹妹
名媛妹妹 2021-01-13 15:17

SslConnector.java interface has been changed in the newest Jetty 7.3.1.v20110307.

Almost all off the methods have been marked as deprecated without mentioni

2条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-13 15:30

    Building on your own answer:

    Server server = new Server();
    
    // Encrypt the connection using a valid certificate/keystore
    SslContextFactory sslContextFactory = new SslContextFactory("path/keystore.jks");
    sslContextFactory.setKeyStorePassword("password");
    
    // Create a new SocketConnector at port 443, which is the default port for
    // HTTPS web pages (no port number needs to be specified in the browser).
    SslSocketConnector sslConnector = new SslSocketConnector(sslContextFactory);
    sslConnector.setPort(443);
    
    // Add the SocketConnector to the server
    server.setConnectors(new Connector[] {sslConnector});
    

提交回复
热议问题