Removed dead code
Added SSL support