
Client-side mTLS for Secure API Communication
Mutual TLS (mTLS) extends traditional TLS security by requiring both the server and client to verify each other's identity through digital certificates. While regular TLS only verifies the server's identity (think of your browser verifying a website), mTLS ensures both parties trust each other before any data exchange occurs. In this post, we explore the client-side implementation of mTLS.
Balu Mathew
Amazon Employee
Published Feb 28, 2025
Mutual TLS (mTLS) is becoming increasingly important for securing sensitive data exchanges between clients and servers. This post outlines a general approach to implementing mTLS for applications communicating with external API endpoints.
- The client application needs to connect to an API endpoint using mTLS
- The server requires clients to use mTLS for API connections
- The client must obtain appropriate certificates for the connection
- Typical setup: Application running on AWS EKS/ECS/EC2
- Considerations: Certificate management, rotation, and deployment.
- Create client-side SSL certificate based on the server's certificate requirements.

1. Generate client certificate based on provider instructions
2. Store certificates securely
- Avoid storing in persistent storage attached to the VM
- Use a secure secret management service to retrieve certificates dynamically at runtime
3. Configure the client application to use mTLS
- This involves code changes to implement mTLS in the API calls

1. Set up an API Gateway to act as a proxy for the external endpoint.
2. Configure the API Gateway with mTLS settings.
3. Direct the client application to communicate with the API Gateway.
4. The API Gateway handles the mTLS connection to the external service.
Benefits:
- Minimal changes to existing application code.
- Centralized management of mTLS connections.
Implementing mTLS enhances the security of API communications by ensuring mutual authentication between the client and server. Choose the pattern that best fits your architecture and operational requirements.
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.