News for hackers. Stuff that matters.
Re:Living with HTTPS by yorhel on Thursday July 19, 2012 @02:04PM (#4267272)
Somewhat related question: It's fairly common for sites to have static files (images/css) served on a different (sub)domain. What are you supposed to do when the html content is being served on HTTPS? Should the static files be on HTTPS as well? If so, wouldn't it need a different certificate? Certificates are only valid for a single domain, after all.
Re:Living with HTTPS by moonboots on Thursday July 19, 2012 @02:22PM (#4267358)
If you don't want to pay a premium for a wildcard certificate, you could just get another certificate for the static subdomain. You can get an unlimited number of free, single subdomain certificates from StartSSL.
Re:Living with HTTPS by pwaring on Thursday July 19, 2012 @03:37PM (#4267703)
"Certificates are only valid for a single domain, after all"

Actually that's not the case, you can get single certificates which cover different domains, using the Subject Alternative Name field.

Re:Living with HTTPS by rmc on Thursday July 19, 2012 @02:07PM (#4267286)
You can get SSL certs that are valid for wild card subdomains, e.g. *.example.com
Re:Living with HTTPS by agwa on Thursday July 19, 2012 @02:22PM (#4267359)
Wildcard certs tend to be very expensive. If you only need two domains it's probably more cost-effective to just buy two certs.

Edit: a downside of using separate certs is that you'll need to serve the respective sites from separate IP addresses, or rely on SNI [1] which isn't supported in older browsers. But if the use case is a separate domain for serving static files, that's probably hosted on a different server/IP address anyways, right?

[1] http://en.wikipedia.org/wiki/Server_Name_Indication

Re:Living with HTTPS by rmc on Thursday July 19, 2012 @03:16PM (#4267604)
if the use case is a separate domain for serving static files, that's probably hosted on a different server/IP address anyways, right?

Not necessarily. People used to have different domains for images/css/js because browsers used to not want to download more than 2 things at the same time from the same domain name. (Back when the web was young and ugly, and bandwidth was scarce, this made sense). By having multiple domains (e.g. a.static.example.com, b.static.example.com etc.) on the same IP addres/server, you could trick browsers into downloading more in parallel and make your site seem faster. You didn't need multiple IPs for that.

Now-a-days browsers have upped their limit from 2 to something like 8 → 16 or so, so it's less of a problem.

Re:Living with HTTPS by Erwin on Thursday July 19, 2012 @03:31PM (#4267669)
A certificate can also have a number of alternate names, which providers call a Unified certificate -- UCC. The nice thing about that is that you can add/remove names after you've bought the certificate without having to go through the process.

I haven't tried this in practice though, but this might be useful if you want to provide a bunch of client.yourdomain.com secure subdomains from the same IP address. Only downside is that the organization name will be the same.

Re:Living with HTTPS by peterwwillis on Thursday July 19, 2012 @05:21PM (#4268123)
This is also wildly more secure than a wildcard certificate, where if someone nicks your private key your entire domain is compromised, but with UCC only select hosts' security could be compromised. I believe it's also supported in more devices than SNI (since X.509v3)
Re:Living with HTTPS by agwa on Thursday July 19, 2012 @03:35PM (#4267689)
Also more expensive than vanilla single-name certs :-(

That's the one downside of this HTTPS-everywhere movement - we're beholden more than ever to the certificate authority cartel.

Re:Living with HTTPS by yorhel on Thursday July 19, 2012 @02:09PM (#4267293)
Ah, I wasn't aware of that. Thanks!
Re:Living with HTTPS by justhw on Thursday July 19, 2012 @03:22PM (#4267631)
If you are concerned about the warnnings that users see, just call your static files in such a format.

'//www.your-cdn.com/image.jpg'

In other words don't specify http or https in the url, just do '//your-url.com/new.js'

Re:Living with HTTPS by adgar on Thursday July 19, 2012 @02:08PM (#4267290)
Wildcard certificates.