我尝试将ALB
集成到API网关
.
const ecs_url = new apigateway.HttpIntegration("https://" + props!.alb.loadBalancerDnsName);
const api = new apigateway.RestApi(this, `api-${targetEnv}-for-ecs`, { cloudWatchRole: true });
api.root.addMethod('GET',ecs_url);
这使得API像这样,
https://xxxxxxxxxx.execute-api.us-west-2.amazonaws.com/prod
然而,当访问这里时,它给了我一个错误
{"message": "Internal server error"}
cloudwatch中有这样的错误.
Execution failed due to configuration error: Host name 'ss-stag-lb-640244442.us-west-2.elb.amazonaws.com' does not match the certificate subject provided by the peer (CN=*.mydomain.com)
*.mydomain.com设置为该ALB dns,但当我通过浏览器直接访问loadBalancerDnsName
例如(ss-stag-lb-640233333.us-west-2.elb.amazonaws.com)时,它会给出正确的响应.
我有两个问题.
1、我可以绕过证书检查吗?
2、有没有办法给ss-stag-lb-640233333认证.us-west-2.elb.amazonaws.com
?