【发布时间】:2015-11-10 16:09:24
【问题描述】:
我创建了一个 AWS API 网关,并将它指向一个 VPS。我希望能够对我的 VPS 启用客户端 SSL 身份验证。我遵循了 AWS 演练here。我在 API Gateway 控制台中生成了一个 PEM 编码的证书并将其复制到我的 Apache Web 服务器。证书和/或虚拟主机配置似乎导致 Apache SSL 模块中出现致命错误。
错误日志:
[Tue Nov 10 10:53:57.140815 2015] [ssl:info] [pid 7283] AH01914: Configuring server example.com:443 for SSL protocol
[Tue Nov 10 10:53:57.140998 2015] [ssl:trace1] [pid 7283] ssl_engine_init.c(724): Configuring permitted SSL ciphers [!aNULL:!eNULL:!EXP:HIGH:!aNULL]
[Tue Nov 10 10:53:57.141165 2015] [ssl:debug] [pid 7283] ssl_engine_init.c(843): AH01904: Configuring server certificate chain (1 CA certificate)
[Tue Nov 10 10:53:57.141175 2015] [ssl:debug] [pid 7283] ssl_engine_init.c(390): AH01893: Configuring TLS extension handling
[Tue Nov 10 10:53:57.141204 2015] [ssl:emerg] [pid 7283] AH02572: Failed to configure at least one certificate and key for example.com:443
[Tue Nov 10 10:53:57.141226 2015] [ssl:emerg] [pid 7283] SSL Library Error: error:140A80B1:SSL routines:SSL_CTX_check_private_key:no certificate assigned
[Tue Nov 10 10:53:57.141251 2015] [ssl:emerg] [pid 7283] AH02311: Fatal error initialising mod_ssl, exiting. See /var/log/apache2/error.log for more information
AH00016: Configuration Failed
Apache 虚拟主机配置:
<VirtualHost *:443>
ServerName example.com
ServerAdmin webmaster@localhost
DocumentRoot /var/www/example
DirectoryIndex index.html
SSLEngine on
SSLCertificateChainFile ssl/ca.crt
SSLVerifyDepth 1
LogLevel info ssl:warn debug trace1
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
【问题讨论】:
-
您不能要求/使用 SSL 客户端证书,除非您还拥有 SSL 服务器 证书。我在这里没有看到配置的证书及其私钥,
Failed to configure at least one certificate and key for example.com:443似乎表明这是问题所在。 -
@Michael-sqlbot 是的,你是绝对正确的。我创建了一个添加的自签名证书,将密钥和证书添加到 Apache 配置中,并且服务器正在正确启动。现在 API Gateway 抱怨“未知端点错误”。
-
API 网关不太可能使用自签名证书与后端服务器进行协商。它需要对端点进行身份验证,而自签名证书不允许...证书必须来自认可的证书颁发机构才能使身份验证有效。
标签: apache amazon-web-services ssl-certificate pem aws-api-gateway