Restlet 2.1.1内部HTTPS连接器

时间:2013-01-06 22:19:07

标签: java ssl https restlet

我尝试从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。*版本中,我们的代码运行良好。

此致

0 个答案:

没有答案