由於ELB不支持兩種SSL身份驗證,您應該在您的nginx服務器上驗證證書。
您可以像這樣配置nginx服務器以接受來自API網關的客戶端證書。
server {
listen 443;
ssl on;
server_name example.com;
ssl_certificate /etc/nginx/certs/server.crt;
ssl_certificate_key /etc/nginx/certs/server.key;
ssl_client_certificate /etc/nginx/certs/ca.crt;
ssl_verify_client optional;
location/{
root /var/www/example.com/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_param SCRIPT_FILENAME /var/www/example.com/lib/Request.class.php;
fastcgi_param VERIFIED $ssl_client_verify;
fastcgi_param DN $ssl_client_s_dn;
include fastcgi_params;
}
}
然後,使用API網關控制檯上的測試調用功能來測試此設置是否適用於您。
我不確定這是文檔錯誤還是實際問題,但他們當前在「已知問題」中列出了nginx作爲後端,可能不支持與API網關兼容的SSL客戶端身份驗證:http:// docs。 aws.amazon.com/apigateway/latest/developerguide/api-gateway-known-issues.html –