0

我尝试从 restlet 2.0.15 更新到 2.1.1。我没有收到任何错误,我可以启动我的应用程序。使用默认的 restlet 连接器,但是当我尝试通过 https:/url:port/ 访问我的 ssl 安全内容时,我总是会超时并且绝对没有日志。HTTP 连接器工作正常。

我也尝试使用简单的框架,但是restlet只在简单的HTTP连接器上启动,而https仍然在内部?

这是我当前的配置:

this.componentHTTPS = new Component();
this.componentHTTP = new Component();

Server serverHTTPS = new Server(Protocol.HTTPS, this.sslPort);
Server serverHTTP = new Server(Protocol.HTTP, this.port);
    serverHTTPS.setContext(this.componentHTTPS.getContext().createChildContext());

Router routerHTTP = new Router(serverHTTP.getContext());
String redirectTarget = this.sslURI + ":" + this.sslPort;
Redirector redirector = new Redirector(serverHTTP.getContext(),
            redirectTarget, Redirector.MODE_CLIENT_PERMANENT);
Extractor extractor = new Extractor(serverHTTP.getContext(), redirector);

extractor.extractFromQuery("", "", false);
routerHTTP.attach("/", extractor);
componentHTTP.getServers().add(serverHTTP);
componentHTTPS.getServers().add(serverHTTPS);

Series<Parameter> parametersHTTPS = serverHTTPS.getContext().getParameters();

// increase maximumSeries<Parameter>ds (RESTlet default is 10)
parametersHTTPS.add("maxThreads", this.maxThreads);
parametersHTTPS.add("sslContextFactory","org.restlet.ext.ssl.PkixSslContextFactory");
parametersHTTPS.add("keystorePath", this.keystorePath);
parametersHTTPS.add("keystorePassword", this.keystorePassword);
parametersHTTPS.add("keystoreType", this.keystoreType);
parametersHTTPS.add("keyPassword", this.keyPassword);
parametersHTTPS.add("needClientAuthentication", "false");

componentHTTPS.getDefaultHost().attach("/", webApplication);

// Start the http redirect component
componentHTTP.getDefaultHost().attach("/",
            new RedirectApplication(redirectTarget));

this.componentHTTPS.start();
this.componentHTTP.start();

其他人有这个问题或知道解决方案吗?在之前的 restlet 2.0.* 版本中,我们的代码运行良好。

问候

4

0 回答 0