Added SSL support, not too pretty though