Vertx (3.9.x) ベースの HTTP サーバーがあり、2 セットの要求パスに対応する必要があります。最初のパスは常にクライアント証明書 ( ClientAuth.REQUIRED
) と、クライアント証明書がオプションの別のパス (ClientAuth.REQUEST
またはClientAuth.NONE
) を想定しています。
ClientAuth
ご覧のとおり、設定できる場所のみが でありHttpServerOptions
、特定のポートにバインドされます。以下のサンプル コード スニペット:
final HttpServerOptions options = new HttpServerOptions()
.setPort(443)
.setClientAuth(ClientAuth.REQUIRED) // One option per listening port.
// Set all other server options
ルーターの設定は次のようになります。
final Router router = Router.router(vertx);
router.route("/required-client-cert/").handler(this::handleMutualAuth);
router.route("/no-need-client-cert/").handler(this::handleRegularAuth);
// Any one of the above routes can work anytime, because ClientAuth is configured in server options.
単一の Vertx アプリケーション内でこれを処理することは可能ですか? はいの場合、どのように?
単一のポートでリッスンしているときに、代替手段はありますか?
ありがとう。