fixed bug
added SSL support