
AWS Site-to-Site VPN Now Supports Post-Quantum Additional Key Exchange (ML-KEM-768), So I Connected and Checked the VPN Logs
This page has been translated by machine translation. View original
Introduction
On November 19, 2026, it was announced that AWS Site-to-Site VPN now supports post-quantum key exchange.
With the CreateVpnConnection and ModifyVpnTunnelOptions APIs, you can set a post-quantum key exchange method in the VPN tunnel options.
This article introduces how to specify the additional key exchange, and verifies the method of the established tunnel using the VPN logs and the CGW-side logs.
Test Environment
- Region: Tokyo (ap-northeast-1)
- AWS CLI: 2.41.2
- VPN connection: connected to a VGW, static routing, two tunnels
- CGW stand-in: EC2 (Ubuntu 24.04 arm64, t4g.small) with an Elastic IP assigned
- strongSwan: 6.1.0 (built from source with
--enable-ml)
Configuring the Tunnel Options
Additional Key Exchange Fields
The post-quantum key exchange method is specified as an additional key exchange that follows the initial DH exchange. The additional key exchanges are passed in the tunnel options Phase1AdditionalKeyExchanges (phase 1) and Phase2AdditionalKeyExchanges (phase 2). Both are arrays, and each element takes the following three fields.
| Field | Description |
|---|---|
| AdditionalKeyExchangeRound | The round number of the additional key exchange. 1 in this test |
| KeyExchangeMethods | The IANA IKEv2 key exchange method number. 35 is ML-KEM-512, 36 is ML-KEM-768, and 37 is ML-KEM-1024. If you omit it or leave it empty in an optional round, that round is disabled |
| Requirement | With required, the tunnel is not established unless the CGW supports this round. With optional, the round is negotiated if the CGW supports it |
In this test I used ML-KEM-768 (36). You can check the list of methods you can specify in the API reference.
Specifying at Creation
Create a CloudWatch Logs log group as the destination for the VPN logs.
aws logs create-log-group --log-group-name /pqvpn-verify/vpn
aws logs describe-log-groups --log-group-name-prefix /pqvpn-verify/vpn --query 'logGroups[0].arn' --output text
The ARN returned by describe-log-groups ends with :*. When passing the ARN to LogGroupArn in LogOptions, I used the following form with the :* removed.
arn:aws:logs:ap-northeast-1:<アカウント ID>:log-group:/pqvpn-verify/vpn
For tunnel 1, specify ML-KEM-768 as required in both phase 1 and phase 2. Tunnel 2 is created without specifying an additional key exchange. Save the following content as create-vpn-options.json and replace LOG_GROUP_ARN with the ARN above.
{
"StaticRoutesOnly": true,
"TunnelOptions": [
{
"IKEVersions": [{"Value": "ikev2"}],
"Phase1EncryptionAlgorithms": [{"Value": "AES256"}],
"Phase1IntegrityAlgorithms": [{"Value": "SHA2-256"}],
"Phase1DHGroupNumbers": [{"Value": 20}],
"Phase2EncryptionAlgorithms": [{"Value": "AES256"}],
"Phase2IntegrityAlgorithms": [{"Value": "SHA2-256"}],
"Phase2DHGroupNumbers": [{"Value": 20}],
"Phase1AdditionalKeyExchanges": [
{"AdditionalKeyExchangeRound": 1, "KeyExchangeMethods": [{"Value": 36}], "Requirement": "required"}
],
"Phase2AdditionalKeyExchanges": [
{"AdditionalKeyExchangeRound": 1, "KeyExchangeMethods": [{"Value": 36}], "Requirement": "required"}
],
"LogOptions": {"CloudWatchLogOptions": {"LogEnabled": true, "LogGroupArn": "LOG_GROUP_ARN", "LogOutputFormat": "json"}}
},
{
"IKEVersions": [{"Value": "ikev2"}],
"Phase1EncryptionAlgorithms": [{"Value": "AES256"}],
"Phase1IntegrityAlgorithms": [{"Value": "SHA2-256"}],
"Phase1DHGroupNumbers": [{"Value": 20}],
"Phase2EncryptionAlgorithms": [{"Value": "AES256"}],
"Phase2IntegrityAlgorithms": [{"Value": "SHA2-256"}],
"Phase2DHGroupNumbers": [{"Value": 20}],
"LogOptions": {"CloudWatchLogOptions": {"LogEnabled": true, "LogGroupArn": "LOG_GROUP_ARN", "LogOutputFormat": "json"}}
}
]
}
Pass this file to --options to create the VPN connection.
aws ec2 create-vpn-connection --type ipsec.1 --customer-gateway-id <CGW ID> --vpn-gateway-id <VGW ID> --options file://create-vpn-options.json --output json
Changing After Creation
Add a phase 1 additional key exchange afterward to tunnel 2, which is not connected to the CGW. The modify-tunnel2-enable.json for adding it is as follows.
{
"Phase1AdditionalKeyExchanges": [
{"AdditionalKeyExchangeRound": 1, "KeyExchangeMethods": [{"Value": 36}], "Requirement": "required"}
]
}
In modify-tunnel2-disable.json for disabling it, set Requirement to optional and omit KeyExchangeMethods.
{
"Phase1AdditionalKeyExchanges": [
{"AdditionalKeyExchangeRound": 1, "Requirement": "optional"}
]
}
Pass either file to --tunnel-options in the following command. The example is for adding; to disable, replace it with modify-tunnel2-disable.json.
aws ec2 modify-vpn-tunnel-options --vpn-connection-id <VPN ID> --vpn-tunnel-outside-ip-address <トンネル2の外側 IP> --tunnel-options file://modify-tunnel2-enable.json
After adding it, I retrieved the settings to confirm they were applied, and then disabled it. The result retrieved after disabling is as follows.
aws ec2 describe-vpn-connections --vpn-connection-ids <VPN ID> --query 'VpnConnections[0].[State,Options.TunnelOptions[].[OutsideIpAddress,Phase1AdditionalKeyExchanges]]' --output json
[
"available",
[
[
"198.51.100.10",
[
{
"AdditionalKeyExchangeRound": 1,
"KeyExchangeMethods": [
{
"Value": 36
}
],
"Requirement": "required"
}
]
],
[
"198.51.100.20",
[
{
"AdditionalKeyExchangeRound": 1,
"Requirement": "optional"
}
]
]
]
]
I ran this change after connecting to tunnel 1 from the CGW using the steps described later. While the additional key exchange was being added to and disabled on tunnel 2, the Status of tunnel 1 stayed UP. LastStatusChange also remained unchanged from 2026-11-20T12:41:02+00:00. The IKE SA on the strongSwan side was also maintained.
Configuring the CGW
Install strongSwan on the EC2 instance acting as the CGW and connect to AWS tunnel 1.
Building strongSwan
I built strongSwan 6.1.0 with --enable-ml added to configure to enable the ml plugin.
Build script
#!/bin/bash
# Build and install strongSwan 6.1.0 on the EC2 CGW stand-in (Ubuntu 24.04 arm64)
set -e
VER=6.1.0
export DEBIAN_FRONTEND=noninteractive
sudo apt-get update -qq
sudo apt-get install -y -qq build-essential libssl-dev libgmp-dev pkg-config bzip2 curl tcpdump
cd /tmp
curl -sSfLO https://download.strongswan.org/strongswan-$VER.tar.bz2
tar xjf strongswan-$VER.tar.bz2
cd strongswan-$VER
./configure --prefix=/usr --sysconfdir=/etc --enable-swanctl --enable-vici --enable-ml --disable-stroke --disable-scepclient --disable-gmp
make -j"$(nproc)"
sudo make install
Connection Settings
Save the following content to /etc/swanctl/swanctl.conf. The ke1_mlkem768 in proposals corresponds to ML-KEM-768 in round 1 on the AWS side. ecp384 corresponds to DH group 20 on the AWS side.
connections {
aws-tunnel1 {
version = 2
local_addrs = <CGW_PRIVATE_IP>
remote_addrs = <AWS_TUNNEL1_IP>
proposals = aes256-sha256-ecp384-ke1_mlkem768
if_id_in = 42
if_id_out = 42
dpd_delay = 10s
local {
auth = psk
id = <CGW_EIP>
}
remote {
auth = psk
id = <AWS_TUNNEL1_IP>
}
children {
aws-tunnel1 {
local_ts = 0.0.0.0/0
remote_ts = 0.0.0.0/0
esp_proposals = aes256-sha256-ecp384-ke1_mlkem768
start_action = start
dpd_action = restart
}
}
}
}
secrets {
ike-aws-tunnel1 {
id = <AWS_TUNNEL1_IP>
secret = "<PSK1>"
}
}
Fill in the placeholders with the following values.
- CGW_PRIVATE_IP: The private IP of the EC2 instance
- CGW_EIP: The Elastic IP assigned to the CGW
- AWS_TUNNEL1_IP: The OutsideIpAddress of tunnel 1 in the VPN connection creation response
- PSK1: The PreSharedKey of tunnel 1 in the same response
To output the charon log to /var/log/charon.log, save /etc/strongswan.conf with the following content.
strongswan.conf
charon {
filelog {
charon {
path = /var/log/charon.log
time_format = %Y-%m-%dT%H:%M:%S
default = 1
ike = 2
cfg = 2
net = 1
append = no
flush_line = yes
}
}
}
Start charon in the background, wait 3 seconds, and then load the configuration. Since start is specified for start_action, the connection starts as soon as the configuration is loaded.
sudo bash -c "nohup /usr/libexec/ipsec/charon > /tmp/charon.out 2>&1 &"
sleep 3
sudo swanctl --load-all
Verifying the Establishment
VPN Logs on the AWS Side
In the log group, a log stream of the form <VPN ID>-<tunnel outside IP>-IKE.log is created for each tunnel. Retrieve the events of tunnel 1 with the following command.
aws logs get-log-events --log-group-name /pqvpn-verify/vpn --log-stream-name <VPN ID>-<トンネル1の外側 IP>-IKE.log --start-from-head --query 'events[].message' --output text
The output lists the message (a JSON string) of each event. Below are four entries extracted from the details value of each message. The order is the same as in the original log.
Selected proposals for Phase 1 SA: Encryption: AES256 Hash: SHA2-256 PRF: SHA2-256 DH Group(s): 20 Additional Key Exchange 1: 36
AWS tunnel processed request (id=1) for IKE_INTERMEDIATE exchange
AWS tunnel Phase 1 SA is established
Selected proposals for Phase 2 SA: Encryption: AES256 Hash: SHA2-256 DH Group(s): None PFS: None
The line showing the phase 2 selection result has None for both DH Group(s) and PFS, and neither the specified DH group 20 nor the additional key exchange 36 appears. The phase 2 additional key exchange was required, but the first child SA created in IKE_AUTH was established without using either. The proposal that strongSwan selected for the child SA, ESP:AES_CBC_256/HMAC_SHA2_256_128/NO_EXT_SEQ, also contains no key exchange.
strongSwan on the CGW Side
The IKE SA line and the method line from the output of sudo swanctl --list-sas are as follows. The KE1_ML_KEM_768 at the end of the method is the ML-KEM-768 selected in the additional key exchange.
aws-tunnel1: #1, ESTABLISHED, IKEv2, 7c5a9da5c37ad55a_i* 150e0359c67730c3_r
AES_CBC-256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/ECP_384/KE1_ML_KEM_768
From charon.log, you can confirm the loading of the ml plugin, the selected proposal, and the IKE_INTERMEDIATE request and response.
2026-11-20T12:39:54 00[LIB] loaded plugins: charon random nonce x509 revocation constraints pubkey pkcs1 pkcs7 pgp dnskey sshkey pem openssl pkcs8 xcbc cmac kdf ml drbg attr kernel-netlink resolve socket-default vici updown counters
2026-11-20T12:39:57 02[CFG] selected proposal: IKE:AES_CBC_256/HMAC_SHA2_256_128/PRF_HMAC_SHA2_256/ECP_384/KE1_ML_KEM_768
2026-11-20T12:39:57 02[ENC] generating IKE_INTERMEDIATE request 1 [ KE ]
2026-11-20T12:39:57 02[ENC] splitting IKE message (1264 bytes) into 2 fragments
2026-11-20T12:39:57 14[ENC] parsed IKE_INTERMEDIATE response 1 [ KE ]
Response from describe-vpn-connections
Check the tunnel status in VgwTelemetry of describe-vpn-connections.
aws ec2 describe-vpn-connections --vpn-connection-ids <VPN ID> --query 'VpnConnections[0].VgwTelemetry' --output json
[
{
"AcceptedRouteCount": 1,
"LastStatusChange": "2026-11-20T12:41:02+00:00",
"OutsideIpAddress": "198.51.100.10",
"Status": "UP",
"StatusMessage": ""
},
{
"AcceptedRouteCount": 1,
"LastStatusChange": "2026-11-20T12:39:20+00:00",
"OutsideIpAddress": "198.51.100.20",
"Status": "DOWN",
"StatusMessage": ""
}
]
Summary
With AWS Site-to-Site VPN supporting post-quantum additional key exchange, I was able to confirm that ML-KEM-768 is used in the following two places.
- VPN log on the AWS side:
Selected proposals for Phase 1 SA: ... DH Group(s): 20 Additional Key Exchange 1: 36. Method number 36 is ML-KEM-768 - strongSwan's
swanctl --list-sas:KE1_ML_KEM_768at the end of the method
If you use Site-to-Site VPN for workloads where guidelines or similar require support for post-quantum key exchange, please try this update.
