Hello. I'm trying to write a small FTP client using asio, and I'm having trouble getting SSL/TLS working. What I want to do is to connect to the FTP server normally, and send "AUTH TLS" in cleartext to the server, and if successfull switch over to SSL. I have tried to use a ssl::stream to connect to the server, and while not in SSL mode, using async_write() / async_read_until() with stream_.next_layer(). This works fine, and everything is sent, but when the client enter SSL mode, the server only receives junk from the client, while the client receives good responses from the server. I've checked and double checked- I am using stream_ while in SSL mode, not stream_.next_layer(). So, async_read_until() seems to work with stream_ in SSL mode, but async_write() doesn't. Any ideas? Is there a better way to do this? Daniel