How to enable post-quantum key exchange on Libreswan

Libreswan 5.4 added ML_KEM_768 to IKE_SA_INIT and IKE_INTERMEDIATE and requires NSS 3.118.1 or newer, but the facts do not show it on by default, so administrators must add an extra key exchange to ike= and verify it themselves.

On this page

Can Libreswan enable ML-KEM key exchange today, and what does it take?

Libreswan 5.4 can negotiate ML-KEM-768 key exchange, but the facts supplied do not show it enabled by default, so administrators should plan to add it to their configuration rather than expect it to appear after an upgrade. Libreswan v5.4, dated August 13, 2026, added ML_KEM_768 support in the IKE_SA_INIT and IKE_INTERMEDIATE exchanges and requires NSS 3.118.1 or newer. The changelog does not describe the feature as on without configuration, so the likely route is an additional key exchange, such as addke1= set alongside ike= in ipsec.conf. The ipsec.conf man page copy available to us predates this work and does not mention addke1, so the exact syntax should be confirmed against the man page for the version you run.

The scope here is key exchange only. The v5.4, v5.4.1 and v5.4.2 changelog entries, checked as of 2026-12-03, do not mention ML-DSA, SLH-DSA or any post-quantum signature authentication. Your RSA or ECDSA certificates, the leftrsasigkey and leftcert settings and the NSS certificate database at /var/lib/ipsec/nss remain unchanged by this feature. A tunnel with ML-KEM key exchange still authenticates peers with classical public-key signatures, so the inventory of certificates and signing keys is a separate task from enabling ML-KEM.

Treat this as a configuration task for administrators. Before changing anything, confirm the NSS version on each gateway meets the 3.118.1 minimum, check the release you run (5.4, 5.4.1 or 5.4.2) against the changelog, and test the proposal on a non-production tunnel. Note also that the changelog lists IKE_FOLLOWUP_KE support for 5.4 while one mirrored man page says otherwise, so verify that point with the upstream documentation before you rely on it. Rocky Linux 10.3 release notes describe ML-KEM-1024 as well, while the upstream changelog names only ML_KEM_768, so confirm which parameter sets your build supports.

Which Libreswan versions and components the key exchange facts apply to

This table separates each key exchange fact by Libreswan version, configuration option and source, so you can see which claim applies to which release and component. Read the rows for ML-KEM and RFC 9370 as key exchange only, since none of the listed items show post-quantum signatures or certificates. Confirm the exact behavior on your own build before relying on any single row.

ItemWhat the facts sayApplies toSource and date
Libreswan 5.4 and laterAdds ML_KEM_768 support in IKE_SA_INIT and IKE_INTERMEDIATE exchanges and requires NSS 3.118.1 or newerKey exchange only, version 5.4 and laterLibreswan CHANGES and 5.4 GitHub release, v5.4 dated August 13, 2026
Libreswan 5.4.1Adds a test for CVE-2026-77205 (fips-cert-leak) in the FIPS area, with no post-quantum key exchange entry listedFIPS-related fix, not key exchangeLibreswan CHANGES, v5.4.1 dated October 5, 2026
Libreswan 5.4.2Current release on the home page, with no post-quantum key exchange or signature entry listed in the changelogRelease, not key exchangeLibreswan home page and CHANGES, v5.4.2 dated November 16, 2026
ipsec.conf keyexchange=Accepts ikev2 (default) or ikev1, replacing the older ikev2=yes|no optionConnection setting, does not enable ML-KEMLibreswan ipsec.conf man page (copy predates 5.4 ML-KEM work)
ipsec.conf ike= and esp=ike= sets phase 1 proposals as cipher-hash-modpgroup. esp= sets Child SA algorithms. Whether ML-KEM is added to ike= is not stated in the man page copy checked. Confirm the addke1= syntax in your version's documentation.Connection settings, key exchange and Child SALibreswan ipsec.conf man page, checked 2026-12-03
NSS requirementML-KEM support requires NSS 3.118.1 or newer. Certificate material is kept in an NSS database at /var/lib/ipsec/nss by default, selectable with --nssdir.Library dependency for key exchangeLibreswan CHANGES and documentation
RFC 9370 items (IKE_ADDITIONAL_KE, IKE_INTERMEDIATE)Implemented in 5.4 for multiple key exchanges. These cover key exchange only and do not apply to signatures or certificates.Key exchange only, not signatures or certificatesLibreswan CHANGES and 5.4 GitHub release, v5.4
IKE_FOLLOWUP_KEThe CHANGES file lists 5.4 support, but a third-party mirror of the man page says 5.4 does not support it. Unresolved, so confirm with the project before relying on it.Key exchange only, status unresolvedLibreswan CHANGES and a third-party mirror of the man page
ML-DSA and post-quantum signaturesNo ML-DSA, SLH-DSA or post-quantum signature authentication appears in the v5.4, v5.4.1 or v5.4.2 changelog entries. Certificates and RSA or ECDSA authby= settings are unchanged by these facts.Signatures and certificates, not supported per the changelogLibreswan CHANGES, checked 2026-12-03

Which parts of Libreswan the key exchange setting touches

Enabling post-quantum key exchange in Libreswan is not a single switch. It touches the IKE exchanges, the proposal string in ike=, the NSS library and database underneath them, and the authentication settings that stay classical. Check each part below before you change a production gateway.

IKE_SA_INIT and IKE_INTERMEDIATE exchanges

The key exchange runs in IKE_SA_INIT and, for ML-KEM, in IKE_INTERMEDIATE. Libreswan 5.4 added ML_KEM_768 to both, following RFC 9370 for the intermediate exchange. Confirm that both peers run a version that negotiates these exchanges, since a peer on an older release will not offer the new key exchange. This is where an ML-KEM group would be negotiated, so treat it as the place to verify in a lab first.

Libreswan 5.4 release

The ike= proposal string

The ike= option sets IKE proposals in the form cipher-hash-modpgroup, and omitted parts fall back to allowed defaults. Adding a post-quantum key exchange means listing it explicitly, and the current man page does not show the ML-KEM syntax, so confirm the exact form in the release you run. Because omitted parts default to all allowed values, review the full resulting proposal rather than assuming the new group is the only one offered.

ipsec.conf man page

NSS library version dependency

Libreswan's ML-KEM support requires NSS 3.118.1 or newer, so the NSS version on each gateway sets whether the feature works at all. Check the NSS package your distribution ships against the Libreswan build you run. An upgrade of Libreswan alone may not be enough if NSS stays older.

Libreswan CHANGES

NSS database and --nssdir location

Certificate material lives in an NSS database, which defaults to /var/lib/ipsec/nss. The --nssdir option selects another directory, so confirm which path your gateway reads before changing its configuration. Keep a backup of the database before any upgrade, since certificate nicknames referenced by leftcert must still resolve after the change.

Libreswan documentation

Classical authentication and certificate settings

The authby settings and certificates remain classical. ECDSA and RSA signatures authenticate the gateways, and leftrsasigkey or leftcert point to RSA or ECDSA material in the NSS database. Libreswan's changelog does not document ML-DSA or SLH-DSA signature support, so adding a post-quantum key exchange does not change how peers prove their identity. Plan certificate work separately from the key exchange change.

ipsec.conf man page

The ppk option as a separate mechanism

The ppk option uses post-quantum preshared keys based on RFC 8784, and the man page marks it EXPERIMENTAL. It is a different mechanism from the ML-KEM key exchange and does not replace it. Accepted values are propose, yes, insist and never or no. Treat ppk as an option to evaluate in a test environment, not as the main post-quantum setting.

ipsec.conf man page

How to enable ML-KEM-768 in Libreswan step by step

This sequence turns on ML-KEM-768 as an additional key exchange in Libreswan 5.4 or later, with a backup taken first and a check at each stage that the post-quantum exchange is actually negotiated with a peer. It covers the version prerequisites, the ipsec.conf change, the restart and verification, and confirmation that the other end also supports ML-KEM.

  1. Confirm Libreswan and NSS versions

    Run the installed Libreswan version check (for example, ipsec --version) on every gateway that will use ML-KEM, and confirm it reports 5.4 or later. The Libreswan 5.4 changelog says ML_KEM_768 support requires NSS 3.118.1 or newer, so check the NSS library version your distribution ships as well, using the package manager's query for the nss package. Some distributions backport or repackage these components, so confirm with your distribution's release notes if the versions differ from upstream. This step is closed when both versions are recorded for each gateway, and any gateway below the minimum is scheduled for an upgrade before continuing.

  2. Back up ipsec.conf and the NSS database

    Before changing any setting, copy the existing /etc/ipsec.conf and the NSS database directory, which is /var/lib/ipsec/nss by default unless a different directory was set with --nssdir. Store the copies somewhere outside the gateway so a failed change can be rolled back. Keep a note of the current ike= line so the original proposal can be restored exactly. This step is closed when the copies exist, you have confirmed they are readable, and the gateway's current IPsec tunnels are known to be working before any change.

  3. Add ML-KEM-768 to the ike= proposal

    In the connection definition in ipsec.conf, add ML-KEM-768 as an additional key exchange to the existing ike= proposal. The changelog names the algorithm as ML_KEM_768. The additional key exchange is inferred to use the addke1= option, which is not confirmed in the supplied documentation, so verify the exact syntax against the 5.4 ipsec.conf man page on your system before relying on it. Keep the existing classic key exchange in place, since ML-KEM does not appear to be enabled by default and the peer may need a classic fallback. This step is closed when the edited file passes a syntax check and the change is limited to the connection under test.

  4. Restart pluto and confirm the exchange

    Restart the Libreswan service so pluto loads the new connection settings, then bring the tunnel up. Watch the pluto log and look for the negotiated key exchange, and confirm that ML_KEM_768 appears in the proposal and selection messages for the IKE_SA_INIT and IKE_INTERMEDIATE exchanges. If the log shows only the classic exchange, the tunnel negotiated without ML-KEM and the configuration needs review. This step is closed when a log entry or a test peer shows ML-KEM-768 as the negotiated exchange on the tunnel.

  5. Confirm the peer supports ML-KEM

    ML-KEM is negotiated only when both ends support it, so confirm with the operator of the other gateway, or check its documented version and settings, that it accepts ML-KEM-768 in IKEv2. If the far end is a different product, confirm its support with its own vendor, because the Libreswan changelog does not describe other implementations. Where you control both ends, repeat the verification on the peer by checking its log for the same exchange. This step is closed when the peer's support is confirmed in writing or by the log evidence described above.

  6. Record the change and rollback path

    Write down the Libreswan and NSS versions, the exact ipsec.conf change, the backup locations, and the log evidence that ML-KEM-768 was negotiated. Record the rollback steps so the previous ike= line can be restored and the service restarted if the tunnel fails. Keep this record with the change ticket for the gateway. This step is closed when the change record is complete and filed.

How enablement differs by distribution build and peer support

Upstream Libreswan 5.4 adds ML_KEM_768 to the IKE_SA_INIT and IKE_INTERMEDIATE exchanges, and the changelog says it requires NSS 3.118.1 or newer. The changelog does not describe ML-KEM as enabled by default, so the connection must name it explicitly, most likely as an additional key exchange such as addke1= alongside ike=. Confirm that option name and its syntax in the 5.4 documentation for your exact build before you deploy it.

  • Version floor: Confirm both Libreswan 5.4.x and NSS 3.118.1 or newer are installed.
  • ML-KEM-768 only: The upstream changelog names ML_KEM_768 and does not name ML-KEM-1024.
  • Explicit selection: No vendor statement says ML-KEM is enabled without configuration, so plan a visible setting in each connection.
  • Signatures unchanged: The 5.4.x entries do not mention ML-DSA, SLH-DSA or post-quantum signature authentication, so authentication stays on the existing RSA or ECDSA settings.
  • Unresolved point: The changelog lists IKE_FOLLOWUP_KE support for 5.4, but one man page copy says 5.4 does not support it. Test this in your own environment.

Before you rely on an upstream 5.4.x build, test a connection to a peer that you control and confirm the negotiated key exchange in the logs.

Where the ML-KEM exchange sits in the IKEv2 handshake

The diagram is illustrative and starts with the IKE_SA_INIT exchange, where the initiator and responder agree on proposals and run the first Diffie-Hellman exchange. When addke1= is configured for ML-KEM-768, an IKE_INTERMEDIATE exchange follows, carrying the additional key exchange defined in RFC 9370 and the ML_KEM_768 share that Libreswan 5.4 supports. Only after both key exchanges complete does IKE_AUTH run. Authentication is still performed with the RSA or ECDSA credentials configured in authby=, so enabling the key exchange does not change how the peers authenticate. Check that the NSS version meets the 3.118.1 requirement and that both peers run Libreswan 5.4 or later.

Illustrative sequence showing ML-KEM in IKE_INTERMEDIATE, with IKE_AUTH unchanged.

What Libreswan has not published on post-quantum enablement

The Libreswan project has documented ML-KEM key exchange in its 5.4 changelog but has not published several statements that administrators would need to plan enablement. The gaps below cover signatures, configuration defaults, support questions and roadmap, and each card names what to ask the project or check in the release notes before relying on a setting.

No post-quantum signature statement

The v5.4, v5.4.1 and v5.4.2 changelog entries do not mention ML-DSA, SLH-DSA or any post-quantum signature authentication. Your RSA and ECDSA certificates and authby= settings therefore have no documented post-quantum replacement in these releases. Ask the project whether signature authentication is planned, and check each new CHANGES entry for ML-DSA or SLH-DSA before changing leftrsasigkey or certificate issuance.

Libreswan CHANGES

ML-KEM-1024 missing from upstream

Rocky Linux 10.3 states that its Libreswan 5.4 adds ML-KEM-768 and ML-KEM-1024, but the upstream changelog names only ML_KEM_768. If your distribution build offers ML-KEM-1024, confirm with the distribution maintainer which source it comes from, and do not assume the upstream project tested that parameter set. Compare the distribution's package changelog with the upstream CHANGES file before you rely on it.

Rocky Linux 10.3 announcement

No statement that ML-KEM is on by default

No vendor statement says ML-KEM is enabled without configuration, and the changelog does not describe it as on by default. The change appears to require adding an extra key exchange such as addke1= to ike=. Until the project confirms the default, treat ML-KEM as off and test the proposal list on a lab tunnel with the peer you actually use, checking the negotiated algorithm in the logs.

ipsec.conf man page

IKE_FOLLOWUP_KE support is unresolved

The CHANGES file lists IKE_FOLLOWUP_KE support for 5.4, but a third-party mirror of the ipsec.conf man page says 5.4 does not support it. Because multiple key exchanges depend on this exchange, the conflict affects whether a second post-quantum key exchange can be negotiated at all. Ask the project to settle the question in writing, and test the exchange against your peer before depending on it.

Libreswan CHANGES

No CNSA 2.0 roadmap published

The Libreswan home page, the CHANGES file and the 5.4 release notes contain no roadmap statement on ML-KEM-1024, ML-DSA, SLH-DSA or CNSA 2.0. Teams with a federal or national security contract that cites CNSA 2.0 should not assume Libreswan will meet it on a known date. Ask the project directly what it plans, and record the answer with its date in your inventory.

Libreswan home page

No published default ike= proposal list

The ipsec.conf man page describes the ike= defaults for IKEv2 as AES, AES-GCM, DH14 and stronger, and SHA2, but it does not list ML-KEM in those defaults. Administrators who depend on the default cannot tell from the documentation whether an ML-KEM group is offered. Ask the project for the exact default proposal list for 5.4, and write ike= explicitly in your configuration so the negotiated set does not change with the version.

ipsec.conf man page

What can go wrong when turning on ML-KEM in Libreswan

The most common failure is silent. If the ike= proposal string in ipsec.conf does not include an ML-KEM group, Libreswan negotiates the classical groups in the proposal and the connection comes up with no post-quantum key exchange at all. Libreswan's own documentation says omitted parts of ike= default to all allowed values, so a short proposal can look correct while still offering only classical groups. Before relying on a tunnel, confirm the negotiated key exchange with the connection status output and the pluto logs on both peers, not just the fact that the tunnel is up. The changelog does not describe ML-KEM as enabled by default, so the proposal line is the first thing to check.

The second risk is the library dependency. The v5.4 changelog says ML_KEM_768 support requires NSS 3.118.1 or newer. On a system with an older NSS, the configuration can fail to start or can refuse the ML-KEM proposal, depending on how the build handles the missing algorithm. Check the installed NSS version against the Libreswan build and the distribution's packaging notes before you change the proposal on a production gateway. Libreswan keeps certificate material in an NSS database at /var/lib/ipsec/nss by default (or the directory given with --nssdir), so an NSS upgrade is also a change to that database's environment and should be tested the same way.

The third risk sits on the peer side and in the network path. A peer that does not support the same ML-KEM group will reject the exchange, and the two gateways will fall back or fail depending on the proposal ordering and any addke1= settings. The ML-KEM key exchange messages are larger than classical ones, so middleboxes such as firewalls or NAT devices that restrict or fragment UDP traffic may drop or mishandle IKE_INTERMEDIATE messages. Test the change between a pair of gateways you control, with packet captures on the path, before you apply it to a live tunnel. For the denial-of-service issue CVE-2026-77205, affecting the FIPS-related test in v5.4.1, pin to 5.4.2 as the release that includes the fix.

Common questions about Libreswan post-quantum key exchange

Is Libreswan quantum safe?

Libreswan does not carry a quantum-safe claim, and no supported source describes it that way. What the project's own changelog documents is post-quantum key exchange in IKEv2: Libreswan v5.4, dated August 13, 2026, added ML_KEM_768 in the IKE_SA_INIT and IKE_INTERMEDIATE exchanges and requires NSS 3.118.1 or newer. Signature authentication and certificates are not documented as post-quantum. Whether a given deployment is protected depends on the exact version, the ike= proposals in use and the peer's support, so confirm those in your own environment before describing the setup to anyone.

Which Libreswan version do I need for ML-KEM?

The changelog entry that adds ML_KEM_768 is in Libreswan v5.4, dated August 13, 2026. The current release listed on the project home page is 5.4.2, dated November 16, 2026, so the v5.4 series is the starting point. Rocky Linux 10.3 release notes say its Libreswan 5.4 adds ML-KEM-768 and ML-KEM-1024, while the upstream changelog names only ML_KEM_768. Check which build your distribution ships before assuming a parameter set is available.

Does enabling post-quantum key exchange in Libreswan cost money?

Libreswan is free software under GPLv2, so the software itself carries no license fee. The cost is effort: testing the change in a lab, updating the NSS library to a version that supports the feature, reviewing ike= proposals, and coordinating with peers at every other site. Those costs are one-time for the first rollout and recur with each upgrade cycle. If you use a Linux distribution's packages, the distribution may charge for support, which is a separate contract. Ask for any quote to list the hours of testing, the peer coordination and the expected maintenance window.

Is ML-KEM enabled by default in Libreswan?

No supported source states that ML-KEM is on by default. The changelog describes ML_KEM_768 support in v5.4 without saying it is enabled without configuration, and the project has published no vendor statement to that effect. The setup appears to require adding an additional key exchange, such as addke1= in the ike= option, so confirm this in the ipsec.conf man page for your exact version and test a connection before relying on it. The default ikev2 keyexchange and the default ike= proposals should be checked against your own configuration.

Do signatures and certificates change when I enable ML-KEM?

Enabling ML-KEM changes key exchange, not authentication. The Libreswan changelog entries for v5.4, v5.4.1 and v5.4.2 do not mention ML-DSA, SLH-DSA or any post-quantum signature support, so RSA and ECDSA signatures and your certificates in the NSS database remain as they are. In the ipsec.conf man page, authby= and leftrsasigkey or leftcert control authentication, and those settings are unchanged by the ML_KEM_768 entry. Confirm this with the Libreswan project if a reviewer asks about signature algorithms.

What should I ask the Libreswan project or my distributor?

Ask which exact version and NSS release your build includes, and whether ML_KEM_768 and ML-KEM-1024 are both present. Ask whether the IKE_FOLLOWUP_KE behavior listed in the CHANGES file is supported in 5.4, because the man page copy you may read through a mirror says it is not. Ask whether any roadmap exists for ML-DSA, SLH-DSA or CNSA 2.0 parameter sets, since the pages checked published none. Ask for written answers, dated and tied to the version, so your inventory records what was confirmed.

Can my own administrators enable this, or do I need outside help?

Administrators who already run Libreswan can make the configuration change themselves, since the work is editing ipsec.conf, confirming NSS support and testing a connection. Outside help is worth considering when the site-to-site links are many or cross organizational boundaries, when peers run different products that must agree on the same proposals, or when an audit needs a documented test plan. DeployOpen plans, implements and tests this kind of change on a fixed scope, agreed in writing before work starts. Prepare the inventory and the test results first, so any engagement starts from your facts.

How DeployOpen helps plan and verify Libreswan key exchange changes

DeployOpen plans and implements changes to Libreswan key exchange settings inside your own network and infrastructure, starting from your current ipsec.conf and NSS database. The work is scoped in writing before any change, and each step is verified against the Libreswan version you actually run, since ML-KEM support appears in the 5.4 series and depends on NSS version.

How we scope

  • We confirm your Libreswan version and the NSS version it links against, since ML_KEM_768 support in 5.4 requires NSS 3.118.1 or newer.
  • We inventory each connection's ike= and esp= settings, authentication method and NSS certificate database location before proposing any change.
  • The written scope states which connections are changed, which are left as they are, and how we confirm that ML-KEM is negotiated, since the changelog does not describe it as on by default.

How we build

  • We add the additional key exchange settings to ike= on a test gateway pair first, using the syntax your version's ipsec.conf man page documents.
  • We test the change against each peer type you run, because not every IKEv2 peer will negotiate the new key exchange, and failed negotiations must fall back cleanly.
  • We record the exact configuration, package versions and NSS database path in a change log so the state of each connection can be reproduced and reviewed.

How we hand over

  • You receive the tested ipsec.conf changes, the verification steps used on each connection, and a short list of items we could not confirm from upstream documentation.
  • The handover names the unresolved points, including the IKE_FOLLOWUP_KE question and the absence of post-quantum signature support in the 5.4 changelog entries.
  • We walk your network and security teams through the verification procedure so they can repeat it after future Libreswan upgrades.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer, which covers re-checking the configuration when Libreswan or NSS releases change.
  • Before any retainer or fixed-scope work starts, ask us for a written scope listing the connections, the test peers and the deliverables that apply to your environment.
  • Ask for a quote based on that written scope, since DeployOpen does not publish a price list and the effort depends on how many connections and peer types you run.

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.