Troubleshoot Issues in Quantum Safe IPsec VPN
Read this topic to troubleshoot issues in CA certificates, retrieving keys, or establishing tunnels, along with relevant solutions for quantum safe IPsec VPN.
Use this topic to diagnose and resolve certificate, Transport Layer Security (TLS), quantum key retrieval, and tunnel establishment issues in Quantum Safe IPsec VPN deployments.
This topic applies to deployments that use:
-
A firewall providing Quantum Safe IPsec VPN service
-
Quantum Key Distribution (QKD)
-
ETSI QKD APIs
-
X.509 certificates with certificate authority (CA) validation
-
Public key infrastructure (PKI) certificate chains with root and intermediate CAs
-
RSA (2048‑bit, 4096‑bit) and ECDSA cryptographic keys
In QKD deployments, the firewall acts as a Key Management Entity (KME) client and establishes HTTPS connections to the KME server. Before retrieving quantum keys, the firewall validates the KME server certificate chain during the TLS handshake.
To collect diagnostic information, enable PKI and Junos Key Manager (JKM) logging on the firewall:
-
Use PKI tracing for certificate import, certificate-chain validation, and certificate-related TLS failures.
Configure PKI traceoptions to enable logging.
set security pki traceoptions set file pkid-debug size 5m files 5 set flag all commit
Review the log for errors.
show log pkid-debug | match "error|fail"
- Use JKM tracing for QKD or Key Management Entity (KME) connectivity and
key-retrieval failures. JKM tracing writes application logs to
/var/log/jkm.Configure JKM traceoptions to enable logging.
set security key-manager traceoptions set file jkm-debug size 5m files 5 set flag all commit
Review the log for errors.
show log jkm-debug | match "HTTP|UI|OPS|RES|TIME|error|fail"
Troubleshooting Summary
Review the summary table for an overview of the specific failures discussed in this topic:
| Issue Type | Root Cause | Solution |
|---|---|---|
|
Certificate and PKI failures |
|
See Troubleshoot CA Certificate Load Failure Due to Multiple Certificates in a PEM File. |
|
TLS connection failures |
Certificate chain validation fails with HTTP status code 0 or curl response code 60 or the KME server doesn't respond. |
Verify the TLS certificate-verification failure. Check hostname mismatches, certificate validation dates, certificate chain details, CA certificate configuration. See Troubleshoot QKD Key Retrieval Failure Due to Issues in Certificate Chain Validation. |
| Secure application entity (SAE) identifier mismatch |
Firewall SAE identifiers do not match KME SAE identifiers. Although TLS authentication succeeds, ETSI QKD API requests fail to retrieve keys. |
Configure matching |
|
QKD key retrieval failures |
|
See Troubleshoot QKD Key Retrieval Failure Due to KME Server Error. |
Troubleshoot CA Certificate Load Failure Due to Multiple Certificates in a PEM File
Problem
Description
The firewall reads the certificate successfully but fails to load it into a CA profile. The issue occurs during PKI operations when loading a CA certificate into a CA profile.
Symptoms
Symptoms include:
-
The following command displays certificate details but does not load the certificate:
request security pki ca-certificate load ca-profile CA_PROFILE filename /tmp/certs/ca.pem
The command returns the following error:
error: Failed to write the CA certificate to local store
-
A single PEM file contains multiple certificates. The following output appears when you run the command
cat /tmp/certs/ca.pem.-----BEGIN CERTIFICATE----- ... -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- ... -----END CERTIFICATE-----
The PEM file contains multiple certificates. Junos OS requires one certificate per PEM file when loading a CA certificate into a CA profile.
-
Multiple certificates in the chain use the same subject name. The firewall uses the certificate subject name as a unique identifier. If two certificates have the same subject name, the firewall treats the second certificate as a duplicate and does not load it. See [SRX] SRX cannot load two certificates with same Subject at once.
-
The certificate file contains Windows-style CRLF endings, such as \r\n, which can cause PEM parsing issues on the firewall.
Solution
Perform the following steps to resolve the issue:
Ensure that each PEM file contains only one certificate. Avoid combining root and intermediate CA certificates in the same file.
-----BEGIN CERTIFICATE----- (single certificate only) -----END CERTIFICATE-----
Use separate files, such as root-ca.pem and int-ca.pem.
Verify that all certificate files use UNIX line feed (LF) line endings before loading the files onto the firewall.
Configure a separate CA profile for each certificate in the trust chain.
Load the root and intermediate CA certificates separately.
request security pki ca-certificate load ca-profile ROOT_CA_PROFILE filename /var/tmp/certs/root-ca.pem request security pki ca-certificate load ca-profile INT_CA_PROFILE filename /var/tmp/certs/int-ca.pem
Verify that the certificates are loaded.
show security pki ca-certificate detail
Verify each certificate individually.
request security pki ca-certificate verify ca-profile ROOT_CA_PROFILE request security pki ca-certificate verify ca-profile INT_CA_PROFILE
Troubleshoot QKD Key Retrieval Failure Due to Issues in Certificate Chain Validation
Problem
Description
The firewall cannot retrieve QKD keys because TLS certificate validation of the KME server fails.
If certificate validation fails, the TLS handshake does not complete and the key retrieval request fails.
Symptoms
The quantum key manager profile configuration on the firewall is successful. The quantum key manager on the firewall establishes an HTTPS connection to communicate with the KME server for encryption key retrieval. The firewall validates the KME server’s TLS certificate chain using the trusted CAs configured in the quantum key manager profile. However, the TLS connection to the KME server fails, preventing the firewall from retrieving keys from the KME.
The following operational command fails to retrieve keys:
request security key-manager profiles get profile-keys name KM_PROFILE_1
The following logs indicate TLS failure with HTTP status code 0 and curl response code 60.
Feb 24 18:40:36.303721 [DET] [HTTP] ca-cert (/var/db/certs/common/certification-authority/root-ca.cert) added in connection Feb 24 18:40:36.303782 [DET] [HTTP] http-ssl-setup: CA certs added Feb 24 18:40:36.304122 [DET] [HTTP] http-ssl-setup: client-cert-chain added Feb 24 18:40:36.304451 [DET] [HTTP] http-socket-callback: curl socket callback conn-ctx (2.0) action (1) Feb 24 18:40:36.732843 [DET] [HTTP] http-socket-callback: curl socket callback conn-ctx (2.0) action (4) Feb 24 18:40:36.733046 [DET] [HTTP] http-client-request-check-status: req-id (4) URL: https://kme.dmz.example.com:443/api/v1/keys/juniper2/enc_keys DONE http-rsp-code (0) status-code (60) status-str (SSL peer certificate or SSH remote key was not OK) Feb 24 18:40:36.733111 [DET] [TIME] jkm_timer_wheel_stop_timer, stopped timer 4 cb 0x42d150 cbp 0x15c9d40, module 7,.. Feb 24 18:40:36.733148 [DET] [OPS ] op-done: status: (-4097) op_type (3) op_output_data (0xffffdc08) op_ctx (0x1448360) Feb 24 18:40:36.733180 [DET] [TIME] jkm_timer_wheel_stop_timer, stopped timer 4 cb 0x424cf0 cbp 0x1448360, module 5,.. Feb 24 18:40:36.733234 [ERR] [ CM ] cm-client-req-stats-decr: client with id (0) not found Feb 24 18:40:36.733298 [DET] [ UI ] get-data-done: status: (-4097), op_type (3), client_id (0), request_id (4) op_output_data (0xffffdaf0) Feb 24 18:40:36.733728 [DET] [HTTP] http-process-rsp: req-id (4) conn-ctx (2.0) [DELETED] Feb 24 18:40:36.733797 [DET] [ UI ] msg-pre-close-cb: msp-socket (0x1439540) (17) closed
The quantum key manager profile includes only the root CA:
show configuration security key-manager profiles KM_PROFILE_1
The HTTPS key request fails during the TLS handshake because the firewall cannot validate the KME server certificate chain.
This issue can occur when the KME server does not provide the required intermediate CA certificate and the intermediate CA certificate is not configured locally. It can also occur when the firewall policy requires the intermediate CA certificate in the local trusted CA store.
Solution
Determine whether the KME server provides the intermediate CA certificate during the TLS handshake. To resolve this issue, configure the firewall to trust the complete certificate chain as shown below:
If the KME server provides the intermediate certificate chain, configure the root CA certificate in the
trusted-caslist. Root CA trust is sufficient when the KME server provides the required intermediate certificates.[edit]#In configuration mode# set security key-manager profiles KM_PROFILE_1 quantum-key-manager trusted-cas [ ca-root ]
If the KME server does not provide the required intermediate certificate, or if the firewall policy requires local intermediate CA certificates, load the intermediate CA certificate and add it to the
trusted-caslist.[edit]#In configuration mode# set security key-manager profiles KM_PROFILE_1 quantum-key-manager trusted-cas [ ca-root ca-intermediate ]
Verify that the key retrieval is successful after updating the configuration.
#In operational mode# request security key-manager profiles get profile-keys name KM_PROFILE_1
Confirm the logs show a successful HTTP response code and status code 0.
For successful TLS communication, configure the root CA certificate as a trust anchor. Configure intermediate CA certificates locally only when the KME server does not provide them or when the firewall requires them.
Troubleshoot Key Retrieval Failure Due to SAE Mismatch
Problem
Description
TLS communication succeeds, but the firewall cannot retrieve quantum keys from the KME.
Symptoms
You observe the following behavior:
-
From operational mode, enter the following command to view peer device's key manager profile and keys.
request security key-manager profiles get profile-keys name KM_PROFILE_1 peer-sae-id SRX02
The command fails. JKM requests one key by default. If the KME response does not return the requested number of keys, JKM treats the request as a failure. The operational command displays only the failed status:
- Response: - Status: FAILEDReview the JKM log for the KME HTTP response.
-
From operational mode, enter the following command to view key manager profile details.
show security key-manager profiles name KM_PROFILE_1 detail
The command returns the following details. The output shows one failed request.
Name: KM_PROFILE_1, Index: 2, Type: quantum-key-manager Configured-at: 11.09.23 (02:04:32) Time-elapsed: 0 hrs 20 mins 23 secs Url: https://kme.juniper.net Local-sae-id: SRX01 Local-certificate-id: SAE_A_CERT Trusted-cas: [ Root-CA ] Peer-sae-ids: N/A Default-key-size: N/A Request stats: Received: 0 In-progress: 0 Success: 0 Failed: 1
Solution
Align the SAE identifiers on the firewall with the SAE identifiers on the KME. The firewall was initially configured with the SAE IDs SRX01 and SRX02 as local and peer SAE IDs. Perform the following steps to resolve the issue:
Update the firewall key manager profile to use the same SAE IDs configured on the KME. Use SAE_A and SAE_B as the local and peer SAE IDs.
set security key-manager profiles KM_PROFILE_1 quantum-key-manager local-sae-id SAE_A set security key-manager profiles KM_PROFILE_1 quantum-key-manager peer-sae-ids SAE_B set security key-manager profiles KM_PROFILE_1 quantum-key-manager url https://192.168.101.1 set security key-manager profiles KM_PROFILE_1 quantum-key-manager trusted-cas ROOT_CA_CERT set security key-manager profiles KM_PROFILE_1 quantum-key-manager local-certificate-id SAE_A_CERT
Key retrieval is successful after aligning the
local-sae-idandpeer-sae-idsvalues with the corresponding SAE IDs configured on the KME.Alternatively, send a Get Key API request to the KME by using the firewall certificate and private key.
For ETSI QKD key retrieval to succeed, the SAE identifiers configured on the firewall must match the SAE identifiers defined on the KME.
Troubleshoot QKD Key Retrieval Failure Due to KME Server Error
Problem
Description
The firewall fails to retrieve QKD keys from the KME due to a server-side error. The problem is not related to Junos OS configuration or TLS validation, but to KME constraints. An HTTP 503 response confirms that the KME did not successfully fulfill the key-retrieval request.
Symptom
You observe the following:
The following command fails:
request security key-manager profiles get profile-keys-with-id name KM_PROFILE_1 peer-sae-id id1 key-id 12345678-1234-5678-1234-567812345678
The firewall sends a request to the KME and receives an HTTP 503 response. Log indicates that the firewall establishes TLS connection and validates the certificate chain. However, the KME server returns an HTTP response code 503, indicating a server-side error.
```
Feb 24 18:48:48.078293 [CRT] [ UI ] request_profile cli_params name KM_PROFILE_1 peer-sae-id id1 key-id 12345678-1234-5678-1234-567812345678
...
Feb 24 18:48:48.078373 [DET] [HTTP] http-process-req: req-id (3) processing scheduled: url: (https://kme2.dmz.example.com:443/api/v1/keys/id1/dec_keys) post-data ({"key_IDs":[{"key_ID":"12345678-1234-5678-1234-567812345678"}]})
...
Feb 24 18:48:48.260787 [DET] [HTTP] ca-cert (.../root-ca.cert) added in connection
Feb 24 18:48:48.261106 [DET] [HTTP] ca-cert (.../int-ca.cert) added in connection
...
Feb 24 18:48:49.671675 [DET] [HTTP] http-client-request-check-status: req-id (3) URL: https://kme2.dmz.example.com:443/api/v1/keys/id1/dec_keys DONE http-rsp-code (503) status-code (0) status-str (No error)
Feb 24 18:48:49.671753 [ERR] [RES ] kme-response-print-error-message:response msg: (Internal server error.)
```The internal server error message from the KME indicates that the issue occurs when the KME cannot provide the requested key within the allowed retrieval window. Review the KME logs to determine why the KME rejected or could not process the request. Common causes include:
-
The key is no longer available on the responder-side KME.
-
The allowed key retrieval window—typically less than 10 seconds—has expired.
- The KME does not have a matching key for the requested SAE pair.
- Rate limiting due to repeated or delayed requests.
In QKD workflows, the responder must retrieve the key shortly after the initiator. Delayed requests can cause the KME to return HTTP 503.
Solution
To troubleshoot a key-retrieval failure for which the KME returns HTTP 503, review the KME response message in the firewall log.
-
Run the initiator and responder commands back-to-back with minimal delay.
On the initiator, run the following command:
request security key-manager profiles get profile-keys name KM_PROFILE_1 key-count 1 peer-sae-id id2
On the responder, immediately run the following command:
request security key-manager profiles get profile-keys-with-id name KM_PROFILE_1 peer-sae-id id1 key-id 12345678-1234-5678-1234-567812345678
-
Verify KME configuration to ensure the following settings on the KME2:
-
The KME2 stores the key for the correct SAE pair. If it does not, the firewall cannot return the key.
-
Key stream distribution configuration is correct; otherwise, KME2 has no key to return.
-
SAE pairing between endpoints is accurate.
-
Limit repeated requests to avoid rate limiting by the KME.
-
-
If the KME returns temporary backoff responses, retry the key retrieval. If key retrieval returns HTTP 401, correct the client-certificate, authentication, or KME authorization configuration before retrying.
If the TLS validation succeeds but the KME returns HTTP 503, internal server error, the failure indicates a KME issue and did not fulfill the request. Ensure that the responder retrieves the key within the allowed time window. Verify key distribution settings on the KME and avoid excessive requests.
Other Common Issues in Quantum Safe IPsec VPN
Review the following table for other common failures in Quantum Safe IPsec VPN deployments:
| Issue Type | Root Cause | Solution |
|
Connectivity failure to QKD device |
Loss of IP connectivity between the firewall and QKD device due to VLAN mismatch, storm-control actions, port security violations, DHCP issues, Address Resolution Protocol (ARP) inconsistencies, or switch forwarding problems. |
Verify L2 and L3 connectivity. Check VLAN assignments, switch port status, storm-control profile, port-security settings, ARP tables, and routing. Restore stable connectivity before configuring QKD. |
|
Certificate import failure |
Unsupported certificate format (DER instead of PEM), passphrase-protected private keys, unsupported key format, incomplete certificate chain, or validation failures when using a self-signed CA. |
Before importing certificates into the firewall:
|
|
Quantum key retrieval failure due to certificate trust validation issues |
The KME presents an unknown self-signed root certificate, which leads to TLS validation failure and causes the firewall to reject the connection. Typical errors include, This issue doesn't occur when you configure trusted CAs. |
Import the KME root CA certificate into the firewall CA profile and associate the profile with the Quantum Key Manager configuration. Create a CA profile so that the firewall trusts the KME server
certificate: Load the root CA certificate in PEM format using the command,
After you import the root CA certificate, the firewall can validate the KME certificate chain, establish HTTPS sessions, and retrieve QKD keys successfully. Verify the CA certificate using the command, |