-spec authenticate(Conn :: pid(), Side :: client | server, Timeout :: timeout()) -> {ok, node() | undefined} | {error, term()}.