Implemented SSL support. Still kinda buggy