mTLS Client Certificates
Many high-security APIs require mutual TLS (mTLS) authentication where both the client and server present certificates to verify identity. KnoxCall supports storing client certificates as secrets and automatically using them for API requests.What is mTLS?
Standard TLS (HTTPS):When to Use mTLS
Common use cases:- 🏦 Banking APIs (PSD2, Open Banking)
- 🏛️ Government services (IRS, HMRC, tax authorities)
- 🏢 Enterprise B2B APIs (high-security partners)
- 💳 Payment processors (some card networks)
- 🔐 Zero-trust architectures (service mesh, internal APIs)
- Plaid (some endpoints)
- TrueLayer (Open Banking)
- Yodlee
- UK HMRC APIs
- German Tax Authority APIs
- Some AWS services
Certificate Formats
Supported Formats
KnoxCall accepts certificates in PEM format (text-based):Certificate Components
A complete mTLS setup includes:-
Client Certificate (
cert.pem)- Proves your identity to the server
- Signed by a Certificate Authority (CA)
- Contains public key
-
Private Key (
key.pem)- Paired with certificate
- Kept secret (never share!)
- Used to sign requests
-
Passphrase (optional)
- Protects the private key
- Required if key is encrypted
- Stored encrypted in KnoxCall
-
CA Certificate (optional)
- Verifies server’s certificate
- Usually not needed (uses system trust store)
Format Conversion
If your certificate is in a different format: From PKCS#12 (.pfx, .p12) to PEM:Creating a Certificate Secret
Step 1: Prepare Your Certificate
Combine your certificate and private key into a single file:- Certificate must come first
- Private key must come second
- Include the
-----BEGIN/END-----markers - No extra spaces or characters
Step 2: Create Secret in KnoxCall
- Navigate to Secrets → Create Secret
- Fill in details:
-
Upload certificate:
- Paste combined PEM content (cert + key)
- Or upload
.pemfile
-
Optional: Add passphrase
- If your private key is encrypted
- Enter passphrase (stored encrypted)
- Click Create
Step 3: Verify Certificate
After creation, KnoxCall shows:Using Certificates in Routes
Basic Usage
Reference the certificate in your route’s advanced configuration: Route Configuration:- Loads the certificate and private key
- Decrypts the passphrase if present
- Creates mTLS agent for the request
- Presents certificate during TLS handshake
With OAuth2
Some APIs require both OAuth2 and mTLS:- KnoxCall performs OAuth2 token exchange (with mTLS if provider requires it)
- Subsequent API requests use both OAuth2 token and mTLS certificate
Environment-Specific Certificates
Use different certificates for production vs sandbox: Create certificate secret:- Production route → uses production certificate
- Sandbox route → uses sandbox certificate
- Hard fail if environment missing
Real-World Examples
Example 1: Open Banking (TrueLayer)
Requirement: PSD2-compliant Open Banking requires eIDAS certificates Setup:Example 2: Bank XYZ Direct API
Requirement: Corporate banking API with mTLS only (no OAuth2) Create secret:Example 3: Government Tax API
Requirement: HMRC API requires mTLS + OAuth2 + API key Secrets:Security Best Practices
✅ Do This
-
Use passphrase-protected keys
- Extra layer of security
- Prevents key theft if certificate leaked
-
Set certificate expiry reminders
- Certificates expire (typically 1-2 years)
- Set calendar reminder 30 days before expiry
-
Store backups securely
- Keep original
.pfxor.p12file in secure vault - Don’t email certificates
- Keep original
-
Use environment-specific certificates
- Separate certificates for prod/sandbox
- Prevents accidental production API usage in dev
-
Revoke old certificates
- When renewing, revoke old certificate with CA
- Remove from KnoxCall after grace period
❌ Avoid This
-
Don’t share private keys
- Each system should have unique certificate
- Never email or commit to git
-
Don’t use unencrypted keys
- Always use passphrase-protected keys
- Even if “just for testing”
-
Don’t ignore expiry warnings
- Expired certificate = API downtime
- Plan renewal 60 days ahead
-
Don’t hardcode passphrases
- Use KnoxCall’s encrypted passphrase field
- Not environment variables
Certificate Management
Checking Expiry
View expiry in secret detail page:- 90 days: 🟡 Warning (plan renewal)
- 30 days: 🟠 Urgent (renew now)
- Expired: 🔴 Invalid (API calls will fail)
Renewing Certificates
Process:- Obtain new certificate from CA
- Create new secret with different name:
- Test in sandbox first
- Update routes to use new secret:
- Deploy to production
- Monitor for 48 hours
- Delete old secret after grace period
- Old certificate valid until expiry
- New certificate active before expiry
- Update routes during low-traffic period
Rotating Certificates
When to rotate:- Scheduled renewal (before expiry)
- Security incident (suspected compromise)
- Compliance requirement (quarterly rotation)
- Organization change (company rename)
- Generate new CSR (Certificate Signing Request)
- Submit to CA
- Receive and validate new certificate
- Upload to KnoxCall as new secret
- Test in sandbox environment
- Update production routes
- Monitor API calls for 48 hours
- Revoke old certificate with CA
- Delete old secret from KnoxCall
Troubleshooting
”Certificate validation failed”
Problem: KnoxCall rejects your certificate during upload Common causes:-
Incorrect format
-
Missing private key
-
Mismatched cert and key
-
Expired certificate
“mTLS handshake failed”
Problem: API request fails with TLS error Possible causes:-
Wrong certificate uploaded
- Production cert used in sandbox (or vice versa)
- Solution: Check environment-specific values
-
Passphrase incorrect
- Private key is encrypted but passphrase wrong
- Solution: Re-upload with correct passphrase
-
Server doesn’t trust your certificate
- Certificate not from approved CA
- Solution: Obtain certificate from API provider’s required CA
-
Certificate expired
- Check expiry in secret detail page
- Solution: Renew certificate
-
Hostname mismatch
- Certificate’s CN doesn’t match request hostname
- Solution: Obtain cert with correct subject name
“Cannot decrypt private key”
Problem: KnoxCall can’t load your certificate for requests Causes:-
Passphrase wrong or missing
- Encrypted key needs passphrase
- Solution: Update secret with correct passphrase
-
Corrupted key
- Key data damaged during upload
- Solution: Re-upload certificate
-
Unsupported encryption
- Very old key encryption algorithms
- Solution: Re-encrypt key with modern algorithm:
“Private key not found in secret”
Problem: Certificate uploaded but key missing Solution: Ensure your PEM file contains both:Advanced Configuration
Custom CA Certificates
If the API server uses a custom CA:custom_ca_bundle secret (String type):
SNI (Server Name Indication)
For servers requiring specific SNI:Disabling Certificate Verification (NOT RECOMMENDED)
For testing only (never in production):Compliance & Auditing
Audit Trail
All certificate operations are logged:Certificate Access Logs
Every time a certificate is loaded for a request:Compliance Requirements
PCI DSS:- ✅ Certificates encrypted at rest
- ✅ Private keys never logged
- ✅ Access audit trail
- ✅ Expiry monitoring
- ✅ Certificate lifecycle management
- ✅ Change tracking
- ✅ Access controls
- ✅ Secure deletion
- ✅ eIDAS certificate support
- ✅ Qualified signature certificates
- ✅ Environment segregation
API Reference
Create Certificate Secret
Update Certificate (Environment-Specific)
Get Certificate Info (values never returned)
Next Steps
OAuth2 + mTLS
Combine OAuth2 with mTLS authentication
Secret Management
Learn about secret types and management
Environment Secrets
Use different certificates per environment
Certificate Rotation
Best practices for certificate renewal
📊 Guide Info
- Level: Advanced
- Time: 20 minutes
- Prerequisites: Understanding of PKI and TLS
🏷️ Tags
mtls, certificates, security, pki, banking, authentication