How do I test if a cert is going to work on a Cloudfront (or other CDN) deployment?

  • Page Owner: Not Set
  • Last Reviewed: 2023-09-15

I've installed an SSL cert on my Cloudfront (or load balancer, or whatever) proxy for a certain domain, but that domain is already pointing at another site. We want to be sure the cert is going to work when the domain is switched over. How can we test that it will?


Answer

There are two ways that I know:

  1. Update your hosts file and point the domain to the proxy. Clear your DNS and browser cache. Then go to the site in question in a browser.

  2. Use curl to make a request to the proxy, but pretending that request is for the production domain. For example:

curl --connect-to www.calamos.com:443:d3b9qnexhavhma.cloudfront.net:443 https://www.calamos.com

In this case, www.calamos.com is the production domain we want to check. d3b9qnexhavhma.cloudfront.net is the Cloudfront deployment (though it could be any kind of proxy or CDN). If the SSL is invalid, curl will return an error. You can also include -v to see information about the certificate.