如何使用httpd.conf中的一个IP地址在CentOS Apache上设置多个SSL通配符证书
我们有3个域指向一个IP。 其中2个域(app.fr、app.com)需要SSL认证。 我们有子域,我们的证书也支持子域 app.fr具有子域admin.app.fr-在https下可以正常加载 app.com还有一个子域admin1.app.com,它没有加载https 给出了下面的错误如何使用httpd.conf中的一个IP地址在CentOS Apache上设置多个SSL通配符证书,apache,ssl,centos7,Apache,Ssl,Centos7,我们有3个域指向一个IP。 其中2个域(app.fr、app.com)需要SSL认证。 我们有子域,我们的证书也支持子域 app.fr具有子域admin.app.fr-在https下可以正常加载 app.com还有一个子域admin1.app.com,它没有加载https 给出了下面的错误 This server could not prove that it is admin.app.com; its security certificate is from "*.app.fr". This
This server could not prove that it is admin.app.com;
its security certificate is from "*.app.fr". This may be caused by a
misconfiguration or an attacker intercepting your connection.
when I put the app.com vhost 1st and app.fr bellow.
admin1.app.com loads fine
admin.app.fr gives error on load
此服务器无法证明它是admin1.app.fr;
其安全证书来自“*.app.com”。这可能是由于
配置错误或攻击者正在拦截您的连接
它将第一个vhost证书作为默认证书-我猜是这样的
有谁能帮我解决这个问题吗
下面是我的http.conf
<VirtualHost ip:80>
DocumentRoot /app/
ServerAlias *.app.fr
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.+)\.app\.fr$ [NC]
RewriteCond %{HTTP_HOST} !=www.app.fr
RewriteRule (.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>
<VirtualHost ip:80>
DocumentRoot /app/
ServerAlias *.app.com
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(.+)\.app\.com$ [NC]
RewriteCond %{HTTP_HOST} !=www.app.com
RewriteRule (.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</VirtualHost>
<VirtualHost ip:443>
DocumentRoot /app/
ServerAlias *.app.fr
SSLEngine on
SSLCertificateFile /certificate.crt
SSLCertificateKeyFile /fr_server.key
SSLCertificateChainFile /SSLCA2.pem
</VirtualHost>
#SSL app.com
<VirtualHost ip:443>
DocumentRoot /app/
ServerAlias *.app.com
SSLEngine on
SSLCertificateFile /certificate1.crt
SSLCertificateKeyFile /com_server.key
SSLCertificateChainFile /SSLCA2.pem
</VirtualHost>
DocumentRoot/app/
ServerAlias*.app.fr
重新启动发动机
重写cond%{HTTP\u HOST}^(+)\.app\.fr$[NC]
重写cond%{HTTP_HOST}=www.app.fr
重写规则(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
DocumentRoot/app/
ServerAlias*.app.com
重新启动发动机
重写cond%{HTTP\u HOST}^(+)\.app\.com$[NC]
重写cond%{HTTP_HOST}=www.app.com
重写规则(.*)$https://%{HTTP_HOST}%{REQUEST_URI}[L,R=301]
DocumentRoot/app/
ServerAlias*.app.fr
斯伦金安
SSLCertificateFile/certificate.crt
SSLCertificateKeyFile/fr_server.key
SSLCertificateChainFile/SSLCA2.pem
#SSL app.com
DocumentRoot/app/
ServerAlias*.app.com
斯伦金安
SSLCertificateFile/certificate1.crt
SSLCertificateKeyFile/com_server.key
SSLCertificateChainFile/SSLCA2.pem
您需要生成SAN证书。关于如何在同一IP地址上使用ssl配置多个VirtualHost,有足够的指南。不知道你做错了什么,因为你甚至没有说你实际做了什么(即提供完整配置)。我已经添加了我的配置。你确定这是正确的完整配置吗?看起来您在/certificate.crt
中为两个域使用了相同的证书,尽管您声称使用了不同的密钥-这没有意义。是的,我已将正确的证书www.app.fr&www.app.com加载到HttpSw下。您使用哪个客户端访问该站点?它可能是一个不支持SNI扩展的客户端,如果您在同一IP地址上有多个证书,则需要SNI扩展。也就是说,对于多个域,我们也有子域。对于我们购买的每个域,一个用于app.fr,另一个用于app.com.check-out-api.smartystreets.com有一个通配符SAN。多个域以及子域—因此,使用SAN证书是可能的。签出--请参阅我在.conf文件的第2和第4块中添加了一个serverName,分别为serverName other.app.com和ServerAlias*.app.com。然后两个子域都加载并工作。