我目前正在尝试通过HTTPS协议运行我的服务器,但我无法弄清楚哪个.JAR文件丢失(包含的.JAR如下所示):
package 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包括: