conn.c: Code cleanup

Reformat and restructure some code, move all SSL related code into
one single #ifdef block, for example.