Added SSL support.

SSL support works. could use cleaning.