eclipse-vertx/vert.x · error · IllegalArgumentException

Invalid configuration

Error message

Invalid configuration

What it means

Initialization failure in TokenManager.init: the configured key/certificate options object is not a supported type (not KeyStoreOptionsBase, not PemKeyCertOptions, or another unrecognized configuration class), so the token-signing key material cannot be extracted. The message 'Invalid configuration' is a generic sentinel; the input at fault is the conf object configured for QUIC tokens.

Source

Thrown at vertx-core/src/main/java/io/vertx/core/net/impl/quic/TokenManager.java:94

    KeyStore.Entry entry = null;
    if (conf instanceof KeyStoreOptionsBase) {
      KeyStoreOptionsBase keyStoreOptions = (KeyStoreOptionsBase) conf;
      KeyStoreHelper helper = keyStoreOptions.getHelper(vertx);
      KeyStore keystore = helper.store();
      Enumeration<String> aliases = keystore.aliases();
      if (aliases.hasMoreElements()) {
        entry = keystore.getEntry(aliases.nextElement(), new KeyStore.PasswordProtection(keyStoreOptions.getPassword().toCharArray()));
      }
    } else if (conf instanceof PemKeyCertOptions) {
      PemKeyCertOptions pemKeyCertOptions = (PemKeyCertOptions) conf;
      KeyStoreHelper helper = pemKeyCertOptions.getHelper(vertx);
      KeyStore keystore = helper.store();
      Enumeration<String> aliases = keystore.aliases();
      if (aliases.hasMoreElements()) {
        entry = keystore.getEntry(aliases.nextElement(), new KeyStore.PasswordProtection(KeyStoreHelper.DUMMY_PASSWORD.toCharArray()));
      }
    } else {
      throw new IllegalArgumentException("Invalid configuration");
    }
    if (entry != null) {
      signingAlgorithm = SigningAlgorithm.create(entry);
      length = signingAlgorithm.signer().sign(new byte[0]).length;
    } else {
      throw new IllegalArgumentException("KeyStore does not contains a valid entry");
    }
  }

  public SigningAlgorithm signingAlgorithm() {
    return signingAlgorithm;
  }

  public byte[] generateToken(byte[] payload) {
    ByteBuf out = Unpooled.buffer();
    writeToken(out, Unpooled.copiedBuffer(payload), new InetSocketAddress(NetUtil.LOCALHOST4, 8080));
    return ByteBufUtil.getBytes(out);
  }

View on GitHub (pinned to fb308bd8c3)

Solutions

  1. Configure token key material using KeyStoreOptions/JksOptions/Pkcs12Options or PemKeyCertOptions
  2. Fix the QUIC token options construction
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at vertx-core/src/main/java/io/vertx/core/net/impl/quic/TokenManager.java:94 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of eclipse-vertx/vert.x@fb308bd8c3 (2026-09-06). Data as JSON: /api/errors/7ba557ac6eb8c872. Report an issue: GitHub.