How to set up SSL certificate for redirecting a subdomain to localhost

Hi,

You might want to try a "Private CA", which will allow a certificate to be issued to localhost or local addresses.

Public CAs are not allowed to issue a local certificate (e.g. 127.0.0.1 or localhost whatsoever)

It should give you an error claiming "Common Name not match" (since you are using local domains)... However, for reason that your server is responding with Connection Reset... I have no clue...

P.S. Go to serverfault might help you more.