1

我目前正在尝试通过 HTTPS 协议运行我的服务器,但我无法确定缺少哪个 .JAR 文件(包含的 .JAR 如下所列):

包restlethttps;

   import org.restlet.Component;
   import org.restlet.Server;
   import org.restlet.data.Parameter;
   import org.restlet.data.Protocol;
   import org.restlet.util.Series;

   public class RestletHTTPS { 
    public static void main(String[] args) throws Exception {
        // Create a new Component.
        Component component = new Component();

        // Add a new HTTPS server listening on port 8183       
        Server server = component.getServers().add(Protocol.HTTPS, 8082);
        Series<Parameter> parameters = server.getContext().getParameters();

        //parameters.add("sslContextFactory", "org.rest.ext.ssl.PkixSslContextFactory");
        parameters.add("keystorePath", "path...\\serverX.jks");
        parameters.add("keystorePassword", <password>);
        parameters.add("keyPassword", <password>);
        //parameters.add("keystoreType", "JKS");

        // Attach the sample application.
        component.getDefaultHost().attach("/get", new RestletHTTPSApplication());

        // Start the component.
        component.start();
    }
}

-JAR 包括:

  • org.restlet.jar
  • org.restlet.ext.ssl.jar
  • com.noelios.restlet.ext.simple_3.1.jar
  • com.noelios.restlet.ext.ssl.jar
  • org.restlet-2.0.0.jar
  • org.simpleframework-3.1.3.jar
  • org.simpleframework.jar
  • jsslutils-0.5.jar
  • org.restlet.ext.jetty.jar
4

0 回答 0