API网关中VPC-Link HTTPS端点的匹配证书

时间:2019-06-25 07:59:33

标签: amazon-web-services aws-api-gateway amazon-ecs amazon-route53

我想将我的API从HTTP更改为API Gateway中的HTTP,但是出现以下错误:

Endpoint request headers: {x-amzn-apigateway-api-id=ghqsfz8w25, 
Accept=application/json, User-Agent=AmazonAPIGateway_xxxx, 
Host=xxx-nlb-ecs-service-xxx-xxxcea41.elb.eu-west-1.amazonaws.com, 
X-Amzn-Trace-Id=Root=1-xxx-xxx}
Endpoint request body after transformations: 
Sending request to https://xxx-nlb-ecs-service-xxx-xxxcea41.elb.eu-west-1.amazonaws.com
Execution failed due to configuration error: 
Host name 'vpce-xxx007-xxxb1h.vpce-svc-xxx318ce.eu-west-1.vpce.amazonaws.com' does 
not match the certificate subject provided by the peer (CN=*.domain.eu)
Method completed with status: 500

具有以下配置:

  • 使用通配符证书* .domain.eu
  • 通配符证书已分配给NLB 443侦听器
  • NLB与VPC端点服务(AWS PrivateLink)中的vpce-svc-xxx318ce端点集成
  • 通配符证书已分配给API-GW中的自定义域
  • 自定义域包括到不同API的映射(例如:api.domain.eu/api1v1、api.domain.eu/api2v1)

API方法的设置为

使用HTTP时,此配置有效。现在看来,我需要将VPC端点与通配符证书关联。这是我第一次使用AWS,不是网络专家。关于如何解决此问题的任何想法。

谢谢!

1 个答案:

答案 0 :(得分:1)

要完成这项工作

  • 使用ACM为您控制的私有区域提供证书,例如domain.eu
  • 为NLB创建A-Alias记录,例如vpclink-nlb.domain.eu
  • 更新NLB侦听器以使用上述证书
  • 将API网关方法集成端点URL更新为https://vpclink-nlb.domain.eu