login() must be called after getServerPublicHostKey().