Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I reuse SSL certificate on a local machine with the same (locally configured) URL?

Here's a possible scenario.

Let's say I have a website "https://www.mywebsite.com" and there is a valid SSL certificate purchased for this domain.

I want to "mimick" this website on my LOCAL machine for a testing purpose.

So let's say I set up a locally-configured "https://www.mywebsite.com" (which is in essence https://localhost/mywebsite or something similar).

Would I be able to re-use the SSL certificate on my local testing website?

like image 780
ericbae Avatar asked Feb 01 '10 00:02

ericbae


2 Answers

You can re-use your SSL certificate if you configure your DNS so that your test machine is the same domain name as server, which is probably a bad idea.

You can also re-use it on your test machine if you don't mind clicking the box "accept this whacked out ssl cert"... So I suppose that the answer is technically yes, although I wouldn't personally do it.

like image 187
Bear Avatar answered Oct 23 '22 03:10

Bear


It depends what you are trying to test and why you need a certificate for testing.

If you use the certificate, it will correctly encrypt connections using SSL, but any client will get a certificate mis-match error. If you use a self-signed certificate instead, most clients will give you a warning about that, so it might be just as annoying or not.

If you are testing, for instance, a deployment script to make sure everything gets installed in the right place, it will work. If you are testing to make sure your code correctly redirects a non-secure connection to a secure one, it will work.

If you want to test the your website for functionality, usability, bugs, etc. then your testers will likely complain about the certificate warnings or errors, and you're probably better off doing something else.

like image 35
bmb Avatar answered Oct 23 '22 03:10

bmb