简体   繁体   English

如果所有子域都指向网站根目录,则必须使用通配符SSL证书

[英]Is a wildcard SSL cert necessary if all sub-domains point to the website root

I am completely new to SSL certificates and need to purchase one pretty soon. 我是SSL证书的新手,很快就需要购买。 There seems to be a huge price increase when sub-domains come into play. 当子域发挥作用时,似乎价格会大幅上涨。

My question is this: 我的问题是:

I have my site set up so that username.domain.com is rewritten via htaccess to domain.com?user=username 我设置了我的站点,以便通过htaccess将username.domain.com重写为domain.com?user=username

If I have my web site set up so that all sub-domains are virtual and point to the same location, do I need to buy a wild-card SSL Cert? 如果我的网站设置为所有子域都是虚拟的并且指向同一位置,我是否需要购买通配符SSL证书?

If you want the user to be able to view your site by visiting https://username.domain.com and browse under that same domain (meaning they'll always be making requests to https://username.domain.com ), then you're going to need a wildcard SSL certificate. 如果您希望用户能够通过访问https://username.domain.com查看您的网站并在同一个域下浏览(这意味着他们将始终向https://username.domain.com发送请求),那么你将需要一个通配符SSL证书。 If you just have an SSL certificate installed for domain.com, then the request will not have the chance to get rewritten by your server. 如果您只为domain.com安装了SSL证书,则该请求将无法由您的服务器重写。 The browser will throw a security exception first, since the domain on the certificate does not match the domain being viewed. 浏览器将首先抛出安全性异常,因为证书上的域与正在查看的域不匹配。

If you don't mind having your users browse your site at https ://domain.com?user=username, then you could have them first visit http ://username.domain.com and then redirect them to https ://domain.com?user=username. 如果你不介意你的用户在浏览你的网站的https://domain.com用户=用户名,那么你可以让他们先访问http://username.domain.com,然后将其重定向到https:// domain.com?user=username。 Then all secure browsing would have to take place under https://domain.com , and that would eliminate the need for a wildcard certificate. 然后,所有安全浏览都必须在https://domain.com下进行,这将消除对通配符证书的需求。

When you go to purchase your SSL certificate, I would recommend asking for tech support and running your scenario by them. 当您购买SSL证书时,我建议您寻求技术支持并运行您的方案。 I've found Digicert to be very helpful in this regard (and no I do not have any affiliation with them other than being a customer), but I'm fairly certain they will confirm that you need a wildcard certificate. 我发现Digicert在这方面非常有帮助(除了作为客户之外,我并不与他们有任何联系),但我相当肯定他们会确认你需要一个通配符证书。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM