HTTPS 块域
当多个域名指向同一个服务器时。但是您只有这些域之一的证书,是否可以阻止 Apache 中的其他域。但仅限于使用 HTTPS 时,而不是使用 HTTP 时。
我尝试使用 443 端口的 NameVirtualHost 设置。但是,当未找到域时,Apache 会默认为第一个虚拟主机。我希望它拒绝连接。这样,当在不支持的域之一上直接通过 HTTPS 进行连接时,连接将被拒绝,而不是让浏览器因身份错误而显示警告屏幕。
有什么想法吗?
When having multiple domain names point to the same server. But you only have a certificate for one of these domains, is it possible to block the other domains in Apache. But only when HTTPS is used not when HTTP is used.
I tried using a NameVirtualHost setup for 443 port. But when the domain is not found Apache simply defaults to the first virtual host. I would like it to refuse the connection. In this way when connecting directly through HTTPS on one of the not supported domains the connection is refused rather then having the browser display warning screen because of a wrong identity.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不可能。
这是先有鸡还是先有蛋的问题 - 为了验证 https 连接,浏览器会连接并尝试验证证书/公用名和给定的 URL。与端口 443 的第一次握手/连接必须加密。
处理此问题的唯一方法是为所有域设置专用 IP,或者至少为使用 HTTPS 的域设置专用 IP。
Not possible.
This is a chicken and egg problem - to verify an https connection the browser connects and tries to validate the certificate/common name and the given URL. The first handshake / connection to port 443 has to be encrypted.
The only way to handle this problem would be to setup dedicated IPs for all domains - or for at least the domain using HTTPS.
这远非理想,但另一种选择是为您的 HTTPS 站点使用非标准,并且不让服务器侦听端口 443。
It's far from ideal, but another option would be to use a non-standard for your HTTPS site and not have the server listening on port 443.