有谁知道这是为什么,或者如何解决它?
我正在使用 android 通过 httpclient 连接 - 简单连接器恢复连接很好,但 Jetty 每次都会执行新的握手!代码是相同的,这只是我在构建路径上获得的连接器。不断地重做握手会消耗大量的数据和电池 - 问题是我需要客户端身份验证,正如我发现的那样,这不能与简单连接器正常工作。我在这里缺少什么吗?我正在使用如下设置的标准连接。
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();
不确定您使用的 Jetty 版本或它的配置方式,但查看http://wiki.eclipse.org/Jetty/Howto/Configure_SSL http://wiki.eclipse.org/Jetty/Howto/Configure_SSL有一个参数叫allowRenegotiate
默认为false
。也许如果您能弄清楚如何将其设置为 true,您就可以恢复会话?
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)