Fix auth for non-tls servers. Add sample auth programm