Authentication Restlet 2.0.8与Jetty connecter不兼容';t恢复SSL会话,而简单连接器则恢复SSL会话
有人知道这是为什么,或者如何修复它吗 我正在使用android通过httpclient进行连接——简单的连接器可以很好地恢复连接,但Jetty每次都会执行一次新的握手!代码是一样的,这正是我在构建路径上得到的connecter。不断地重复握手会消耗大量的数据和电池——问题是我需要客户端身份验证,正如我发现的那样,这在简单的连接器上无法正常工作。这里有我遗漏的东西吗?我正在使用下面设置的标准连接Authentication Restlet 2.0.8与Jetty connecter不兼容';t恢复SSL会话,而简单连接器则恢复SSL会话,authentication,ssl,jetty,restlet,Authentication,Ssl,Jetty,Restlet,有人知道这是为什么,或者如何修复它吗 我正在使用android通过httpclient进行连接——简单的连接器可以很好地恢复连接,但Jetty每次都会执行一次新的握手!代码是一样的,这正是我在构建路径上得到的connecter。不断地重复握手会消耗大量的数据和电池——问题是我需要客户端身份验证,正如我发现的那样,这在简单的连接器上无法正常工作。这里有我遗漏的东西吗?我正在使用下面设置的标准连接 component = new Component(); component.getClients()
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();
component=新组件();
component.getClients().add(Protocol.FILE);
服务器httpsServer=component.getServers().add(Protocol.HTTPS,444);
Series parameters=httpsServer.getContext().getParameters();
文件pwd=新文件(“.”);
字符串路径=pwd.getCanonicalPath();
字符串keystorePath=path+“/keystore/keypair.jks”;
parameters.add(“SSLContextFactory”、“org.restlet.ext.ssl.PkixSslContextFactory”);
添加(“keystrepath”,keystrepath);
添加(“keystrepassword”、“xxx”);
参数。添加(“密钥密码”、“xxx”);
添加(“keystoreType”、“JKS”);
添加(“ThreadMaxidletimes”,“60000”)//默认空闲时间
添加(“needClientAuthentication”、“true”);
//使用基本身份验证(在SSL下加密)保护restlet。
ChallengeAuthenticator guard=新的ChallengeAuthenticator(null,ChallengeScheme.HTTP_BASIC,“xxx”);
//新页面接收器
Restlet resty=new pagerReceiveApplication();
LoginChecker LoginVerifer=新的LoginChecker();
guard.setVerifier(登录验证程序);
卫兵:下一个(resty);
getDefaultHost().attachDefault(guard);
overrideStatus statusService=新的overrideStatus();
组件。设置状态服务(状态服务);
component.start();
我还没有尝试过,但是通过Jetty的SslSelectChannelConnector
尝试使用NIO连接器是值得的,Restlet参数type=1
。(要使用SslSocketConnector
,类型为type=2
)不确定您使用的Jetty是什么版本或如何配置,但查看有一个名为allowre
的参数,该参数默认为false
。如果您能找出如何将其设置为true,您就可以继续会话了?这与您之前的问题不同吗?这里不应该使用与您在那里使用的相同的解决方案吗?啊,同样的问题,但现在我有了更多的信息-它只在我切换到Simple时起作用,当时还没有意识到。我相信默认情况下,该标志为false,以阻止尚未修复的SSL重新协商安全漏洞。我不认为恢复会话需要这样做,但我不确定——有人能对此发表评论吗?啊啊,这已经解决了。最好检查它是否易受攻击。OpenSSL似乎认为安全重新协商已启用(我猜这意味着它已修复?),太棒了!很好:从allowresume
跳到SSL resume花了一点时间。很高兴这有帮助。