有誰知道這是爲什麼,或者如何解決它?Restlet 2.0.8與Jetty連接器不會恢復SSL會話,而簡單連接器不會
我正在使用android通過httpclient進行連接 - 簡單連接器恢復連接就好了,但Jetty每次都會執行一次新的握手!代碼是一樣的,這只是我在構建路徑上的連接。不斷重做握手使用了大量的數據和電池 - 問題是我需要客戶端身份驗證,正如我發現的那樣,使用Simple連接器無法正常工作。有什麼我在這裏失蹤?我正在使用如下設置的標準連接。
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();
這是不同於你以前的問題http://stackoverflow.com/questions/5643704/reusing-ssl-sessions-in-android-with-httpclient?這裏不一樣的解決方案適用於此處嗎? – Femi
啊,同樣的問題,但現在我有更多的信息 - 只有當我切換到簡單時纔有效,當時還沒有意識到。 – user705142