Search code examples
sslhttpsamazon-s3amazon-cloudfront

Different SSL-certificates for different parts of site


I have a site on example.com that loads all its static components from s.example.com (an amazon cloudfront distribution).

Now i would like to make some pages of example.com to use https so i thought i'd buy a ssl certificate for example.com, but since the pages loads images and other stuff from s.example.com the https will break since some components are not encrypted.

Is it possible to buy a second certificate for s.example.com? The reason i ask is because it's very much cheaper to buy two single-domain-certificates than to buy a wildcard cert.


Solution

  • You should be able to run a page with different https://domains with no alert from the browser as long as all the components inside the page are http or all https.

    <img src="https://example.com/a.jpg"/>
    <img src="https://s.example.com/b.jpg"/>
    

    You'll have to keep the various certificates up to date.