これはなぜですか、それともどのように修正するのですか?Restlet 2.0.8とJettyコネクターはSSLセッションを再開せず、シンプルコネクターは
私は、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();
これは以前の質問とは異なりますか?http://stackoverflow.com/questions/5643704/reusing-ssl-sessions-in-android-with-httpclient?ここで使用したのと同じソリューションをここに適用するべきではありませんか? – Femi
ああ、同じ問題ですが、今はもっと情報があります - 一度シンプルに切り替えてしまえば、それは当時には実現していなかったのです。 – user705142