Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/383.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Restlet 2.1.1内部HTTPS连接器_Java_Ssl_Https_Restlet - Fatal编程技术网

Java Restlet 2.1.1内部HTTPS连接器

Java Restlet 2.1.1内部HTTPS连接器,java,ssl,https,restlet,Java,Ssl,Https,Restlet,我试图从restlet 2.0.15更新到2.1.1。我没有收到任何错误,我可以启动我的应用程序。使用默认的restlet连接器,但当我尝试通过https:/url:port/访问受ssl保护的内容时,总是会超时,并且绝对没有日志。HTTP连接器工作正常 我也尝试过使用simple框架,但是restlet只在simple上启动HTTP连接器,而https仍然在internal上 以下是我当前的配置: this.componentHTTPS = new Component(); this.comp

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

我也尝试过使用simple框架,但是restlet只在simple上启动HTTP连接器,而https仍然在internal上

以下是我当前的配置:

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();
this.componentHTTPS=新组件();
this.componentHTTP=新组件();
Server serverHTTPS=新服务器(Protocol.HTTPS,this.sslPort);
Server serverHTTP=新服务器(Protocol.HTTP,this.port);
serverHTTPS.setContext(this.componentHTTPS.getContext().createChildContext());
Router routerHTTP=新路由器(serverHTTP.getContext());
字符串重定向目标=this.sslURI+:“+this.sslPort;
Redirector Redirector=新的重定向器(serverHTTP.getContext(),
重定向目标、重定向器。模式(客户端(永久);
提取器提取器=新提取器(serverHTTP.getContext(),重定向器);
extractor.extractFromQuery(“,”,false);
routerHTTP.连接(“/”,拔取器);
componentHTTP.getServers().add(serverHTTP);
componentHTTPS.getServers().add(serverHTTPS);
系列参数shttps=serverHTTPS.getContext().getParameters();
//增加maximumSeriesds(RESTlet默认值为10)
参数shttps.add(“maxThreads”,this.maxThreads);
参数shttps.add(“sslContextFactory”、“org.restlet.ext.ssl.PkixSslContextFactory”);
参数shttps.add(“keystrepath”,this.keystrepath);
参数shttps.add(“keystrepassword”,this.keystrepassword);
参数shttps.add(“keystoreType”,this.keystoreType);
参数shttps.add(“keyPassword”,this.keyPassword);
参数shttps.add(“needClientAuthentication”、“false”);
componentHTTPS.getDefaultHost().attach(“/”,webApplication);
//启动http重定向组件
componentHTTP.getDefaultHost().attach(“/”,
新的重定向应用程序(重定向目标);
this.componentHTTPS.start();
this.componentHTTP.start();
还有谁知道这个问题或解决方案吗?在以前的restlet 2.0.*版本上,我们的代码运行良好


关于

能否列出类路径条目及其顺序?请参阅