2.0.8的Restlet与码头连接器无法恢复SSL会话,而简单的连接器确实 [英] Restlet 2.0.8 with the Jetty connecter doesn't resume SSL sessions, while the Simple connecter does

查看:270
本文介绍了2.0.8的Restlet与码头连接器无法恢复SSL会话,而简单的连接器确实的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有谁知道这是为什么,或如何解决?

我使用的是Android HttpClient的通过连接 - 简单恢复连接器的连接就好了,但码头执行每一次新的握手!在code是一样的,这是我已经得到了构建路径正是连接器。不断重做握手使用的数据和电池的荒谬量 - 问题是,我需要客户的认证,这是我发现不符合简易连接器正常工作。有什么事,我在这里丢失?我使用的标准连接如下设置。

 组件=新组件();
。component.getClients()加(Protocol.FILE);
服务器httpsServer = component.getServers()加(Protocol.HTTPS,444)。系列<参数>参数= httpsServer.getContext()getParameters()。文件PWD =新的文件(。);
字符串路径= pwd.getCanonicalPath();
字符串keystorePath =路径+/keystore/keypair.jksparameters.add(SSLContextFactory,org.restlet.ext.ssl​​.PkixSslContextFactory);
parameters.add(keystorePath,keystorePath);
parameters.add(keystorePassword,XXX);
parameters.add(keyPassword,XXX);
parameters.add(keystoreType,JKS);
parameters.add(threadMaxIdleTimeMs,60000); //默认空闲时间
parameters.add(needClientAuthentication,真);//后卫基本身份验证的Restlet(SSL进行加密)。
ChallengeAuthenticator后卫=新ChallengeAuthenticator(NULL,ChallengeScheme.HTTP_BASIC,XXX);//新pagerreceiver
的Restlet resty =新PagerReceiverApplication();LoginChecker loginVerifier =新LoginChecker();
guard.setVerifier(loginVerifier);
guard.setNext(resty);
。component.getDefaultHost()attachDefault(后卫);overrideStatus statusService =新overrideStatus();
component.setStatusService(statusService);component.start();


解决方案

不知道你使用的是什么版本的Jetty或者它是如何配置的,但是看着的 http://wiki.eclipse.org/Jetty/Howto/Configure_SSL 有一个名为参数 allowRenegotiate 即默认为。或许,如果你能弄清楚如何将它设置为true,你就可以恢复会话?

Does anyone know why this is, or how to fix it?

I'm using an android to connect via httpclient - the Simple connector resumes the connection just fine, but Jetty performs a new handshake each time ! The code is the same, it's just what connecter I've got on the build path. Continually redoing the handshake uses up a ridiculous amount of data and battery - the problem is that I require client authentication, which as I've discovered doesn't work properly with the Simple connecter. Is there something I'm missing here? I'm using the standard connection set up as below.

component = new Component();
component.getClients().add(Protocol.FILE);
Server httpsServer = component.getServers().add(Protocol.HTTPS, 444);

Series<Parameter> parameters = httpsServer.getContext().getParameters();

File pwd = new File(".");
String path = pwd.getCanonicalPath();
String keystorePath = path + "/keystore/keypair.jks";

parameters.add("SSLContextFactory", "org.restlet.ext.ssl.PkixSslContextFactory");
parameters.add("keystorePath", keystorePath);
parameters.add("keystorePassword", "xxx");
parameters.add("keyPassword", "xxx");
parameters.add("keystoreType", "JKS");
parameters.add("threadMaxIdleTimeMs", "60000"); //default idle time
parameters.add("needClientAuthentication", "true");

// Guard the restlet with BASIC authentication (encrypted under SSL).
ChallengeAuthenticator guard = new ChallengeAuthenticator(null, ChallengeScheme.HTTP_BASIC, "xxx");

//new pagerreceiver
Restlet resty = new PagerReceiverApplication();

LoginChecker loginVerifier = new LoginChecker();
guard.setVerifier(loginVerifier);
guard.setNext(resty);
component.getDefaultHost().attachDefault(guard);

overrideStatus statusService = new overrideStatus();
component.setStatusService(statusService);

component.start();

解决方案

Not sure what version of Jetty you are using or how it is configured, but looking at http://wiki.eclipse.org/Jetty/Howto/Configure_SSL there is a parameter called allowRenegotiate that defaults to false. Perhaps if you can figure out how to set it to true you'll be able to resume sessions?

这篇关于2.0.8的Restlet与码头连接器无法恢复SSL会话,而简单的连接器确实的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆