Doh, fix the error message to say SSL_read not SSL_write.