question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

API Gateway uses wrong certificate

See original GitHub issue

Hey,

thanks for help!

I am using serverless-domain-manager to manage custom domains for my serverless app. I believe I have set up everything according to the examples, but I still get the wrong cert.

custom:
  ...,
  customDomain:
    domainName: '${self:provider.stage}.${self:service}.ASD.MYDOMAIN.com'
    stage: ${self:provider.stage}
    certificateName: '*.ASD.MYDOMAIN.com'
    createRoute53Record: true
    endpointType: 'regional'
    certificateArn: 'CERTIFICATE ARN'

after running

sls create_domain --stage production
sls deploy --stage production

I expected to see my certificate *.MYDOMAIN.com, but instead I see one from AWS: *.execute-api.eu-west-1.amazonaws.com

image

I also checked in the AWS console > API Gateway > Custom Domains > MY_API > ACM Certifiate and they have my *.MYDOMAIN.com certificate there.

Any ideas? Thx for your help.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:11

github_iconTop GitHub Comments

4reactions
ankitkatiyar91commented, May 12, 2022

We had the same problem and the issue was that the DNS record was pointing to the API Gateway endpoint. Not to the Target Domain Name endpoint of the Custom Domain Names. Because of this the cert was coming for *.execute-<api-region>.amazonaws.com.

3reactions
nziehncommented, Sep 3, 2018

I found the issue: I was using a regional custom domain, but not a regional api gateway.

Surprising that this works without throwing an error.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot wrong certificate returned for API Gateway ...
I tried to make an API request to my Amazon API Gateway custom domain name, but the wrong certificate was returned. How do...
Read more >
HTTP API - Custom Domain (Regional) - incorrect SSL cert?
API Gateway, HTTP API, Invoke URL ** - mapped to custom domain above. Both ** and ** appear to be sending the same...
Read more >
API Gateway custom domain certificate error - Stack Overflow
Certificate you chose from dropdown in Custom Domain of API Gateway does not satisfy dns you're hitting. Only vitalservices-3.docriot.com or ...
Read more >
Configuring mutual TLS authentication for an HTTP API
When you update your custom domain name to use a new truststore version, API Gateway returns warnings if certificates are invalid. API Gateway...
Read more >
Unsupported Certificate Purpose Error When Using Two Way ...
Oracle API Gateway - Version 11.1.2.1.0 and later: Unsupported Certificate Purpose Error When Using Two Way SSL In Oracle API Gateway.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found