How to verify client-certificate in AWS Lambda

Viewed 14857

I'm new to Lambda... Assuming I have an API Gateway that invokes my Lambda function (node.js) upon some HTTPS POST request from the web, how do I perform SSL peer authentication of the original HTTP client?

For example, let's say some server on the internet performs an HTTP POST to my API Gateway, which in turn invokes my Lambda. I want my Lambda to allow requests only from a client whose SSL certificate is associated to a specific domain..

thanks!

2 Answers

Lambda does not deal with SSL certificates. API Gateway does.

Also, API Gateway does not provide you with HTTP endpoints, only HTTPS.

From the FAQ:

Q: Can I create HTTPS endpoints?

Yes, all of the APIs created with Amazon API Gateway expose HTTPS endpoints only. Amazon API Gateway does not support unencrypted (HTTP) endpoints. By default, Amazon API Gateway assigns an internal domain to the API that automatically uses the Amazon API Gateway certificate. When configuring your APIs to run under a custom domain name, you can provide your own certificate for the domain.

To set up your specific domain, see the following link:

Set up Custom Domain Name for API Host Name

Related