Rebar of https://github.com/processone/ejabberd/blob/master/src/cyrsasl.erl