In Net::LDAP::Bind::decode, use $sasl->tiesocket replace $sasl->securesocket, then the connection
will not be closed when BIND completed. But after BIND success, the Net::LDAP module will complain the socket handle ($ldap->socket)
not a GLOB reference when it try to write data to the socket. finally, I find I can use $socket->{fh}. But the new problem appear.
All the func call in Authen::SASL::Cyrus::Security will recur infinitely and the stack will overflow finally. I have to use IO::Socket's send and recv funcs replace print and sysread call in READ and WRITE funcs in Authen::SASL::Cyrus::Security .
There are assorted issues with Authen::SASL::Cyrus::Security. It makes assumptions about the size of encrypted packets, based on the length of decrypted data, where any relationship is completely dependent on block size. As a result, reads can easily block.
I've got some patches that attempt to clear this up, but I'm still seeing problems where occasionally packets coming from the server are replayed at the client. I've not (yet) been able to trace what's causing this.
If you're interested in my patches, with this caveat, you're welcome to them.
Cheers,
Simon.
