How to configure post-quantum algorithms in rustls

rustls with the aws-lc-rs provider offers hybrid X25519MLKEM768 key exchange in its defaults, and standalone ML-KEM only through a custom key exchange list. Settings, version and test steps are below.

On this page

Which rustls setting turns on post-quantum key exchange today

With rustls 0.23.48 (released 3 December 2026) and the aws-lc-rs crypto provider, the hybrid group X25519MLKEM768 is preferred by default, so a connection that negotiates it uses post-quantum key exchange without extra code. Standalone MLKEM768 and MLKEM1024 are not in the default list. To offer them, build a custom kx_groups list from the aws-lc-rs ALL_KX_GROUPS set, which contains kx_group::MLKEM768 and kx_group::MLKEM1024, and pass the provider through with_crypto_provider on the config builder. The ring provider offers no post-quantum key exchange, so a ring-backed setup will not negotiate these groups. Remember that this covers key exchange only. Certificate signatures are a separate question, and ML-DSA certificate support is discussed on its own section of this page.

The kx_groups list is in preference order, with the first element at highest priority, so the position of a group in your custom list decides what a client or server tries first. Install the provider early in startup with install_default(), before any call to ClientConfig::builder() or ServerConfig::builder(), because a process can set its default provider only once. The 0.23.48 release notes also say that P-384 is now preferred over X25519 and P-256 in the default order for both providers, so a setup that relied on the previous order should check which group is actually negotiated. Confirm the agreed group at run time by calling negotiated_key_exchange_group on the connection after the handshake completes, since it returns None while the handshake is still in progress.

Do not assume a standalone ML-KEM group is in use because you listed it. Clients that do not offer it will fall back to another group, and the rustls defaults manual warns that users may see unexpected connection failures when the post-quantum group is enabled without checking the peers. Test each peer you talk to, including load balancers and proxies in front of the service, and confirm the negotiated group in your logs before you rely on it. The prefer-post-quantum crate feature is now obsolete and has no effect, so do not use it to set priority.

Post-quantum settings in rustls by version, provider and key exchange group

Each row is a provider or configuration path in rustls, and each column shows which key exchange groups it offers, the source that documents it, and what the sources leave open. Read it to find which setting gives you X25519MLKEM768 or standalone ML-KEM, and which paths offer no post-quantum key exchange. Note that the sources do not say which ML-DSA parameter sets are supported.

ConfigurationPost-quantum key exchange groupsSource and what the sources do not say
aws-lc-rs default (version 0.23.48)X25519MLKEM768 is preferred regardless of crate features. Standalone MLKEM768 is not in the default list.rustls 0.23.48 release notes (3 December 2026). The sources do not say how the default order behaves on earlier versions.
aws-lc-rs with custom kx_groupsCan include MLKEM768 and MLKEM1024, which are listed in ALL_KX_GROUPS but not DEFAULT_KX_GROUPS. Order follows the list, first element highest priority.rustls CryptoProvider and aws_lc_rs kx_group docs. Confirm group availability in your own build before relying on standalone ML-KEM.
ring providerNo post-quantum key exchange. The ring provider does not support post-quantum algorithms.rustls GitHub and 0.23.48 release notes. rustls::crypto::ring::default_provider() is deprecated.
rustls-post-quantum crate 0.2.4Exposes the MLKEM768 and X25519MLKEM768 statics and a provider function.rustls-post-quantum docs. The sources do not describe how this crate's provider interacts with the default aws-lc-rs provider.
FIPS feature (fips crate feature)Keeps only groups whose fips() method returns true when the default kx groups are used. ALL_KX_GROUPS is not filtered.rustls FIPS manual and aws_lc_rs mod.rs. The FIPS manual does not mention ML-KEM, so whether ML-KEM is covered is not stated.
prefer-post-quantum crate featureDocumented as obsolete with no effect in 0.23.48. It previously controlled group priority with aws-lc-rs.rustls crate docs. Do not enable it expecting a priority change. Confirm behavior in your version.
ML-DSA certificates (aws-lc-rs, 0.23.44 and later)Not a key exchange group. ML-DSA certificate support is enabled by default in aws-lc-rs.rustls 0.23.44 release (7 September 2026). Not supported in the public web PKI. The sources do not say which ML-DSA parameter sets (such as ML-DSA-87) are supported, or whether SLH-DSA is supported.

How do you enable MLKEM768 in a rustls configuration

Enabling MLKEM768 in rustls is a configuration task, not a feature flag. The sources show that the standalone ML-KEM groups are not in the default list, so you must pass a custom key exchange list to your config builders. Start by installing a CryptoProvider early in process startup, before any call to ClientConfig::builder() or ServerConfig::builder(). Call rustls::crypto::aws_lc_rs::default_provider().install_default() once, because install_default() can succeed at most once per process and the rustls CryptoProvider docs say it should run before any builder use. Then, for the list itself, use the aws-lc-rs ALL_KX_GROUPS list, which contains kx_group::MLKEM768 and kx_group::MLKEM1024. The DEFAULT_KX_GROUPS list does not contain standalone MLKEM768, which is offered only in hybrid with X25519 by default.

Next, build a custom CryptoProvider whose kx_groups field holds the groups you want, in preference order, with the first element at highest priority. Pass that provider into the builder with with_crypto_provider, the method the rustls crate docs describe for config builders. Include the hybrid X25519MLKEM768 group if you want a fallback path, because a standalone group can cause connection failures when the peer does not offer it. The rustls defaults manual warns that users may see unexpected connection failures for exactly this reason. Test against each peer you talk to, and confirm the agreed group with negotiated_key_exchange_group() on the connection, which returns None until the handshake completes. Note that the 0.23.48 release notes say the aws-lc-rs provider prefers the hybrid group regardless of crate features, so verify the order in your own build rather than assuming it.

If you use the rustls-post-quantum crate (version 0.2.4 in the sources), it exposes the statics MLKEM768 and X25519MLKEM768 plus a provider function, which can replace hand-written group lists. Confirm with the crate's documentation how those statics are wired into a provider before relying on them. Two checks apply regardless of approach: confirm that the peer offers the group you chose, and confirm for FIPS deployments that the group is covered, because the FIPS manual's default_fips_provider() filters groups by their fips() result and the sources do not say whether ML-KEM passes that filter. Ask your vendor or the rustls maintainers to confirm before you treat FIPS mode as post-quantum ready.

Which rustls components the key exchange setting touches

Turning on post-quantum key exchange in rustls is not one switch. It runs through the CryptoProvider, the config builders, the kx_group list and, for standalone ML-KEM, a separate crate. Certificate signatures are a different layer, so check them separately.

CryptoProvider and its key exchange list

The CryptoProvider holds the kx_groups list, which is ordered by preference, with the first element at highest priority. The list you pass decides which groups a handshake can offer. Install the provider with install_default() early in startup, before any call to ClientConfig::builder() or ServerConfig::builder(). A process can install a default provider only once, so confirm nothing else sets one first.

CryptoProvider docs

Config builders and custom providers

A provider you build yourself is passed to the config builders through with_crypto_provider. Use this when the default key exchange list does not match what you need. Enabling the custom-provider feature turns off implicit use of the built-in providers, so the application must install a provider explicitly. Check the chosen provider on the built config.

rustls crate features

The kx_group module and standalone ML-KEM

The aws-lc-rs kx_group module lists MLKEM768, MLKEM1024, X25519MLKEM768 and the classical groups. The ALL_KX_GROUPS list contains the standalone ML-KEM groups, but DEFAULT_KX_GROUPS does not. A standalone ML-KEM group therefore needs a custom kx_groups list. The hybrid X25519MLKEM768 is the group that is preferred by default.

kx_group docs

The rustls-post-quantum crate

The rustls-post-quantum crate, at version 0.2.4, exposes the MLKEM768 and X25519MLKEM768 statics and a provider function. Use it when you want those groups in a provider you construct yourself. Confirm the crate version your build resolves, because the built-in aws-lc-rs groups and this crate are separate sources of the same group names.

rustls-post-quantum docs

Certificate signatures: ECDSA, Ed25519 and RSA

Key exchange and certificate signatures are separate. Server and client authentication rely on ECDSA, Ed25519 or RSA signatures, and changing the key exchange group does not change them. Ed25519 is not supported by the WebPKI for publicly trusted certificates. Check which signature type your certificates use before you assume anything about authentication.

rustls features manual

ML-DSA certificates in 0.23.44

Release 0.23.44 enabled ML-DSA certificate support by default in the aws-lc-rs provider. ML-DSA certificates are not supported in the public web PKI, and they can only be used with private certificate hierarchies. The sources do not state which ML-DSA parameter sets are supported. Confirm that with the project before you issue any ML-DSA certificate.

0.23.44 release notes

How the setup differs for FIPS, ring and resumed sessions

The default configuration uses the aws-lc-rs provider, which the rustls repository names as its recommended first-party provider and which offers the post-quantum algorithms. In this setup the provider's default key exchange list includes the hybrid X25519MLKEM768 group, and rustls 0.23.48 prefers it regardless of crate features. Standalone ML-KEM groups are not in the default list, so they only appear if you build a custom list. Check the negotiated group on a live connection rather than assuming it from the configuration.

  • Hybrid group first: The 0.23.48 release notes of 3 December 2026 say the aws-lc-rs provider prefers X25519MLKEM768 regardless of crate features.
  • P-384 ordering: The same release moved P-384 ahead of X25519 and P-256 in the default order for both aws-lc-rs and ring.
  • Standalone ML-KEM is off by default: MLKEM768 appears in the kx_group module, but DEFAULT_KX_GROUPS offers it only in hybrid with X25519.
  • Obsolete feature flag: The prefer-post-quantum crate feature has no effect in 0.23.48.
  • Verify the result: Use negotiated_key_exchange_group on an established connection to confirm which group was agreed.

Confirm the rustls version in your lockfile is 0.23.48 or later before relying on this ordering, and confirm the group on a test connection with your own peers.

What to check in order when you enable post-quantum key exchange

This sequence confirms that a rustls build can offer post-quantum key exchange, that the process installs the provider that supports it, and that each client and middlebox path negotiates a group you have chosen and recorded. It ends with a dated test record you can hand to a security or vendor-risk reviewer.

  1. Confirm the rustls version and provider

    The engineer who owns the build checks the rustls version in Cargo.lock and confirms it is at least 0.23.48, the latest release listed as of 3 December 2026. Next, confirm that the aws-lc-rs provider is enabled and that ring is not the provider in use, because the 0.23.48 release notes deprecate rustls::crypto::ring::default_provider() and state that ring does not support post-quantum algorithms. The step is done when cargo tree shows rustls 0.23.48 or later with rustls-aws-lc-rs as the provider and no code path calls the deprecated ring default provider.

  2. Call install_default() early in startup

    The developer who writes the application entry point calls rustls::crypto::aws_lc_rs::default_provider().install_default() before any call to ClientConfig::builder() or ServerConfig::builder(). The rustls CryptoProvider documentation says a process can set its default provider at most once, so a second call fails and the first provider wins. The step is closed when a startup log or test confirms the call returned Ok, and when a search of the codebase finds no builder call that runs earlier.

  3. Choose the key exchange group list

    The engineer sets the kx_groups list on a custom CryptoProvider and passes it to the config builder through with_crypto_provider. The list is in preference order, with the first element at highest priority. The aws-lc-rs provider prefers the hybrid X25519MLKEM768 group in 0.23.48 regardless of crate features, and the default list does not include standalone MLKEM768, so a standalone ML-KEM setup needs a custom list drawn from the aws_lc_rs kx_group module. Record the exact list in configuration, because the rustls defaults manual notes that standalone MLKEM768 can cause unexpected connection failures with peers that do not offer it. The step is closed when the list is committed in source or config and reviewed against the peers you must support.

  4. Check the negotiated group after the handshake

    The engineer calls negotiated_key_exchange_group() on the connection after the handshake completes and logs the result for each connection. The rustls CommonState documentation says this method returns None while the handshake is still in progress, so a check placed earlier will show nothing and look like a failure. The step is closed when a completed test handshake logs a named group, such as X25519MLKEM768 for a hybrid connection, and a None result is treated as a bug, not as a negotiated outcome.

  5. Test against each client and middlebox

    The test engineer runs handshakes from every client type the service accepts, including browsers, API clients, internal services and any load balancer or proxy that sits between them. For each path, the engineer records whether the handshake succeeds and which group was negotiated, and notes where a middlebox changes or blocks the exchange. Clients that do not offer a post-quantum group will fall back to a classical group, and that outcome is valid if the list allows it. The step is closed when every path in the inventory has a recorded result.

  6. Record the result for the review file

    The security lead or engineer writes a dated record listing the rustls version, the provider, the group list in preference order, each tested client or middlebox, and the group negotiated for each. The record also names any path that fell back to a classical group or failed. The record should state that rustls does not claim its own certification, and that the FIPS manual covers only the aws-lc-rs module under a separate certificate, if FIPS mode is in scope. The step is closed when the record is filed with the change ticket and a reviewer has signed off on it.

Decision path from provider choice to negotiated key exchange group

The path starts with the crypto provider you install, either aws-lc-rs or ring, and that choice decides whether post-quantum groups are available at all. Under aws-lc-rs, you then either keep the default kx_groups list or pass a custom list, since standalone ML-KEM groups appear only in ALL_KX_GROUPS. After the handshake, call negotiated_key_exchange_group on the connection to see which group was agreed. The ring branch ends with no post-quantum group, because ring does not support post-quantum algorithms.

Provider choice and kx_groups setting decide which key exchange group is negotiated.

What the sources do not publish about rustls post-quantum configuration

The rustls sources cover the provider model, the hybrid group defaults and the FIPS setup, but leave several configuration points open. The four items below are the ones an engineer needs to settle with the maintainers or in the code before relying on a given key exchange or signature setting.

ML-DSA parameter sets supported

Release 0.23.44 enabled ML-DSA certificate support by default in the aws-lc-rs provider, but the pages checked do not name which parameter sets, such as ML-DSA-44, ML-DSA-65 or ML-DSA-87, are accepted. Confirm the exact sets by checking the certificate verification code in the aws-lc-rs provider source, or by asking the maintainers directly. The same pages also do not mention SLH-DSA, so do not assume it is available. Note that the release says ML-DSA certificates are not supported in the public web PKI, which limits their use to private certificate hierarchies.

0.23.44 release notes

ML-KEM and FIPS certificate #4816

The rustls FIPS manual says the aws-lc-rs module is covered by FIPS 140-3 certificate #4816, but it does not mention ML-KEM, so the sources do not say whether ML-KEM falls under that certificate. Do not treat ML-KEM groups as FIPS-approved based on the manual. Ask the maintainers which algorithms the certificate covers, and check the aws-lc-rs module's validation record before any compliance statement. The manual also says later aws-lc-rs releases may be covered by later certificates or be pending certification.

rustls FIPS manual

Key exchange settings in the examples

The rustls examples directory includes simple-client.rs, simple-server.rs, tls-client-mio.rs and tls-server-mio.rs, but the listing does not describe key exchange settings. An engineer copying one of these examples will not see how to set a kx_groups list or a custom CryptoProvider. Read the example source to confirm whether it sets a provider explicitly, and use the CryptoProvider docs to build a custom list such as one containing standalone MLKEM768 for a standalone ML-KEM group.

rustls examples

Roadmap coverage of ML-KEM and ML-DSA

The rustls roadmap lists experimental X25519Kyber768Draft00 support in 0.23.2 and FIPS certification of the default library in 0.23, but it names no ML-KEM or ML-DSA work. Do not infer future ML-KEM or ML-DSA changes from the roadmap. Ask the maintainers for their plans on standalone ML-KEM groups, parameter set coverage and any deprecation of the hybrid defaults, and track the release notes for changes to the defaults.

rustls roadmap

What breaks when standalone ML-KEM or the wrong provider is used

Standalone MLKEM768 is the most likely source of unexpected connection failures in rustls. The aws-lc-rs ALL_KX_GROUPS list contains kx_group::MLKEM768 and kx_group::MLKEM1024, but the DEFAULT_KX_GROUPS list does not. By default, ML-KEM is offered only in the hybrid X25519MLKEM768 form. The rustls defaults manual says that standalone MLKEM768 is available separately but not enabled by default out of conservatism, and that users may see unexpected connection failures when they enable it. If you put standalone ML-KEM in a custom kx_groups list, confirm that every peer you talk to offers that group. A client that offers only hybrid or classical groups will fail the handshake against a server that accepts only standalone ML-KEM, and the failure may not point to the key exchange setting. Test each peer pairing in a staging environment before you roll a change out, and keep a classical or hybrid fallback in the list until your peers have confirmed support.

A custom list that omits post-quantum entries fails quietly. If kx_groups is set to classical groups such as SECP256R1, SECP384R1 or X25519, the handshake succeeds with a classical group and nothing in the connection reports a problem. The negotiated_key_exchange_group method on CommonState returns the group that was agreed, and it returns None until the handshake completes, so check it after the handshake in your tests and logs. Record the agreed group for each service and each peer as part of your inventory. Also check that with_crypto_provider or install_default() is called before any ClientConfig::builder() or ServerConfig::builder() call, because the process default is set once and a later call can silently keep another provider in effect. Release 0.23.48 also states that the ring provider does not support post-quantum algorithms, so a ring-backed build offers no post-quantum key exchange at all.

Is rustls quantum safe after these settings, and which version do I need

Is rustls quantum safe after these settings?

It is not accurate to call rustls quantum safe. With the aws-lc-rs provider and the hybrid group X25519MLKEM768 negotiated, the key exchange uses a post-quantum ML-KEM component alongside X25519, so the session key exchange has post-quantum protection. Signatures and certificates are a separate question: authentication still depends on ECDSA, Ed25519 or RSA unless you deploy ML-DSA certificates in a private hierarchy, which the sources say is not supported in the public web PKI. Confirm which group was agreed on a live connection with negotiated_key_exchange_group, since it returns None until the handshake completes. No certification or validation is implied by these settings.

Which rustls version do I need for these defaults?

The defaults described here apply from rustls 0.23.48, the latest release listed as of 3 December 2026. The 0.23.48 release notes say the aws-lc-rs provider prefers the hybrid X25519MLKEM768 group regardless of crate features, and that P-384 is now preferred over X25519 and P-256 in the default order. Earlier versions may order key exchange groups differently, so confirm your exact version in your lock file before relying on any default. Release 0.23.46 carries the fix for advisory GHSA-w44r-93j7-qv28, which matters for clients that resume sessions and want hybrid key exchange to stay in use.

Does enabling post-quantum key exchange in rustls cost extra?

The sources do not state any licensing fee for rustls, which is open source. The main costs are engineering time to change the provider, test handshakes and update dependencies, plus any performance effect on handshakes, which you should measure in your own environment. Hybrid groups add key material to the handshake, so bandwidth and CPU use can rise. Ask your team or any outside provider to quote the work from a written scope covering builds, testing and rollout, and confirm with your own benchmarks whether the added handshake cost is acceptable.

What breaks when post-quantum key exchange is turned on?

The rustls defaults manual warns that users may see unexpected connection failures when standalone MLKEM768 is enabled, which is why it is not on by default. Peers that do not offer a matching group will fail to agree a key exchange, so check both ends before a rollout. Applications that install a custom CryptoProvider must also call install_default() early in startup, before any ClientConfig::builder() or ServerConfig::builder() call, and it can succeed only once per process. Choosing the ring provider leaves you with no post-quantum key exchange, because the 0.23.48 notes deprecate rustls::crypto::ring::default_provider() for this reason.

What should I ask the vendor or maintainer before relying on these settings?

Ask which exact rustls and aws-lc-rs versions you run, and whether the group you expect is actually negotiated against your real peers. Ask whether any FIPS-approved path covers the ML-KEM groups, since the FIPS manual does not mention ML-KEM and cites the aws-lc-rs module under FIPS 140-3 certificate #4816 without claiming rustls itself is certified. Ask whether ML-DSA parameter sets beyond the defaults are supported, because the sources do not state which are supported and do not mention SLH-DSA. Get any statement about future plans in writing, since the roadmap names no ML-KEM or ML-DSA work.

Can our team configure this ourselves, or do we need outside help?

A team comfortable with Rust and TLS can change the provider and key exchange list, since the sources document with_crypto_provider and a custom kx_groups order. The standalone ML-KEM groups are not in the default list and need a custom list built from the aws-lc-rs ALL_KX_GROUPS set, which makes testing against your peers essential. Outside help is most useful for scoping the work, building interoperability tests and preparing evidence for a compliance review. DeployOpen plans and implements self-hosted platforms and runs security testing, and the scope and deliverables would be agreed in writing before any work starts.

How do I confirm which key exchange group is in use?

Call the negotiated_key_exchange_group method on the connection after the handshake completes, since it returns None while the handshake is still in progress. Record the result for a sample of real connections, grouped by peer and by client version, so you see which groups are actually agreed rather than which ones are configured. Compare the result against the group order you intended, and treat any unexpected fallback to classical groups as a finding to investigate. Keep these checks in your test suite so that a dependency update that changes the default order is caught before it reaches production.

How DeployOpen works on this

DeployOpen plans and tests rustls post-quantum key exchange inside the client's own build and infrastructure. The work starts with the provider, groups and client or server pairs in use, then tests whether the hybrid or standalone ML-KEM groups are actually negotiated before anything changes in production.

How we scope

  • We confirm which rustls version and crypto provider the application uses, since post-quantum key exchange is only offered through rustls-aws-lc-rs.
  • We record every client and server pair that must agree on a key exchange group, including any peers that cannot change this year.
  • Engagements are fixed-scope, with the scope, deliverables and timeline agreed in writing before work starts, and ongoing support available as a retainer.

How we build

  • We set up a provider with an explicit kx_groups list, installed early with install_default(), so the negotiated groups are known and not left to defaults.
  • We confirm the standalone ML-KEM groups come from a custom list, because the default list offers only X25519MLKEM768 for post-quantum key exchange.
  • We run test handshakes and read negotiated_key_exchange_group() after each connection to confirm which group was agreed, and retest after each rustls upgrade.

How we hand over

  • We deliver the provider configuration, the test results per client and server pair, and the list of peers that still fall back to classical groups.
  • We document the rustls version in use, since the 0.23.48 release changed group preference order and deprecated the ring default provider.
  • We record the checks for FIPS builds, where ClientConfig::fips() and ServerConfig::fips() are asserted at run time, so compliance reviewers can verify the setting.

How we support

  • We confirm the rustls version carries the GHSA-w44r-93j7-qv28 fix in 0.23.46 or later, which matters for clients that resume sessions with hybrid key exchange.
  • We track rustls releases and the project's notices, and retest hybrid and standalone group negotiation after each upgrade.
  • Continuous testing and upgrades are available as retainers, so the configuration stays verified as peers and rustls change.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.