Adds rudimentary SSL support, reconnection support