Vertx v3.4.1 と vertx-rx-java を使用してサーバーを実行しています。証明書ベースの認証 (相互認証) を有効にする必要があるため、サーバー側で証明書失効チェックを処理しようとしています。
HttpServerOptions の addCrlPath メソッドを使用しようとしています。ただし、すでにロードされている CRL の有効期限が切れた後でも、指定された「パス」または証明書の CRL 配布ポイント (CDP) から CRL をリロードしないようです。Vertx を使用してプログラムで実現する方法に関する API/ドキュメントが見つかりません。
SSLHelper クラスの getTrustMgrFactory メソッドの実装を見てみましたが、サーバーの起動時にのみ提供される CRL を選択するように感じています。
だから、私のクエリは次のとおりです。
- 現在ロードされている CRL の有効期限が切れると、最新の CRL が CDP から自動的にダウンロードされるようにする設定が欠落していますか?
- CDP から自動的にダウンロードされない場合、
addCrlPath
メソッドで提供される同じパスから CRL をリロードできる他の構成はありますか? - Vertx に #1 と #2 の組み込みサポートがない場合、そのようなサポートを組み込みで提供する他の API はありますか?
そうでなければ、私の唯一の選択肢は、これらを自分で処理することです。
以下は、サーバーを初期化するコードです
import io.vertx.core.http.ClientAuth;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.core.net.PfxOptions;
import io.vertx.rxjava.core.Vertx;
import io.vertx.rxjava.ext.web.Router;
import io.vertx.rxjava.ext.web.RoutingContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class VertxServer {
private static final Logger LOGGER = LoggerFactory.getLogger(VertxServer.class);
private Vertx vertx;
public VertxServer(final Vertx v) {
this.vertx = v;
}
public void init() {
vertx.createHttpServer(getHttpServerOptions())
// getRouter() method handles router configuration.
.requestHandler(req -> getRouter().accept(req))
.rxListen()
.doOnSuccess(server -> LOGGER.info("Started listening to server..."))
.doOnError(e -> LOGGER.error("Unable to listen. Server launch failed", e))
.subscribe(
server -> LOGGER.info("Server launched successfully. {}", server),
e -> LOGGER.error("Server launch failed", e))
;
}
private HttpServerOptions getHttpServerOptions() {
HttpServerOptions options = new HttpServerOptions()
.setHost("127.0.0.1")
.setPort(8085);
.setSsl(true)
.setPfxKeyCertOptions(
new PfxOptions()
.setPath("E:\\temp\\certs\\server.pfx")
.setPassword("servercertpass".toCharArray())
)
setTrustStoreOptions(options);
return options;
}
private void setTrustStoreOptions(final HttpServerOptions options) {
PfxOptions pfxOptions = new PfxOptions()
.setPath("E:\\temp\\certs\\client-cert-root.p12")
.setPassword("clientcertrootpass".toCharArray());
options.setPfxTrustOptions(pfxOptions)
.addCrlPath("E:\\temp\\certs\\crls\\client-certs.crl")
.setClientAuth(ClientAuth.REQUEST);
}
// Other methods here, which are not relevant for this question.
}