Support for https servers

Fairly trivial change set.

I generated the test key and cert by following Node TLS docs (http://nodejs.org/api/tls.html#tls_tls_ssl), and added a simple test to ensure the correct protocol is being detected.
for more meaningful to read, should we use official module `url` to instead this string concat?