added SSL support