strongSwan reads credentials from a well-known directory structure underDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/strongswan/strongswan/llms.txt
Use this file to discover all available pages before exploring further.
/etc/swanctl/ and from the secrets section of swanctl.conf. Credentials are loaded into the daemon at runtime using swanctl --load-creds.
Directory structure
Place credential files in the appropriate subdirectory.swanctl --load-creds scans each directory and loads all recognized files automatically.
Private keys placed in
private/, rsa/, or ecdsa/ are automatically associated with certificates in x509/ by matching the public key. You do not need to reference them explicitly in swanctl.conf.Loading credentials
Run
swanctl --load-creds after adding or replacing any certificate or key file. The daemon does not watch the filesystem for changes automatically.Certificates
End-entity certificates
Place PEM or DER-encoded certificates in/etc/swanctl/x509/. Reference them in connection config using the certs parameter:
swanctl.conf
certs is relative to /etc/swanctl/x509/ unless an absolute path is given.
CA certificates
Place CA certificates in/etc/swanctl/x509ca/. You can also reference them per-connection with cacerts:
swanctl.conf
Certificate Revocation Lists
Place CRL files in/etc/swanctl/x509crl/. strongSwan also fetches CRLs dynamically from URIs embedded in certificates.
Enable automatic CRL caching in strongswan.conf to persist fetched CRLs across restarts:
strongswan.conf
Private keys
Place private keys in/etc/swanctl/private/ (or the type-specific directories rsa/ or ecdsa/). Keys are matched to certificates automatically based on the public key.
Supported formats
- PKCS#1 PEM (recommended)
- PKCS#8 PEM
- PKCS#12 bundle
Unencrypted PKCS#1 PEM files placed in
private/, rsa/, or ecdsa/.Secrets in swanctl.conf
Thesecrets section of swanctl.conf holds PSKs, EAP passwords, and optional key passphrases.
IKE pre-shared keys
swanctl.conf
0x prefix, or Base64-encoded with a 0s prefix.
EAP and XAuth passwords
swanctl.conf
Private key passphrases
swanctl.conf
File permissions
Thecharon daemon must be able to read all credential files. Recommended permissions: