![]() ![]() The SSL function should be called again when the connection is established. The underlying BIO was not connected yet to the peer and the call would block in connect()/accept(). The operation did not complete the same TLS/SSL I/O function should be called again later. SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPT This is mainly because TLS/SSL handshakes may occur at any time during the protocol (initiated by either the client or the server) SSL_read_ex(), SSL_read(), SSL_peek_ex(), SSL_peek(), SSL_write_ex(), and SSL_write() will handle any pending handshakes. In particular, SSL_read_ex(), SSL_read(), SSL_peek_ex(), or SSL_peek() may want to write data and SSL_write() or SSL_write_ex() may want to read data. However, if the call was an SSL_write() or SSL_write_ex(), it should be called again to continue sending the application data.įor socket BIOs (e.g. when SSL_set_fd() was used), select() or poll() on the underlying socket can be used to find out when the TLS/SSL I/O function should be retried.Ĭaveat: Any TLS/SSL I/O function can lead to either of SSL_ERROR_WANT_READ and SSL_ERROR_WANT_WRITE. ![]() It is safe to call SSL_read() or SSL_read_ex() when more data is available even when the call that set this error was an SSL_write() or SSL_write_ex(). There is no fixed upper limit for the number of iterations that may be necessary until progress becomes visible at application protocol level. Note that the retry may again lead to an SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE condition. When the BIO is writable again, the same function can be called again. SSL_ERROR_WANT_WRITE is returned when the last operation was a write to a nonblocking BIO and it was unable to sent all data to the BIO. SSL_read() and SSL_read_ex() can also set SSL_ERROR_WANT_READ when there is still unprocessed data available at either the SSL or the BIO layer, even for a blocking BIO. If at a later time the underlying BIO has data available for reading the same function can be called again. It means that not enough data was available at this time to complete the operation. SSL_ERROR_WANT_READ is returned when the last operation was a read operation from a nonblocking BIO. The operation did not complete and can be retried later. SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITE Note that SSL_ERROR_ZERO_RETURN does not necessarily indicate that the underlying transport has been closed. The TLS/SSL peer has closed the connection for writing by sending the close_notify alert. This result code is returned if and only if ret > 0. The following return values can currently occur: The current thread's error queue must be empty before the TLS/SSL I/O operation is attempted, or SSL_get_error() will not work reliably. Thus, SSL_get_error() must be used in the same thread that performed the TLS/SSL I/O operation, and no other OpenSSL function calls should appear in between. In addition to ssl and ret, SSL_get_error() inspects the current thread's OpenSSL error queue. The value returned by that TLS/SSL I/O function must be passed to SSL_get_error() in parameter ret. SSL_get_error() returns a result code (suitable for the C “switch” statement) for a preceding call to SSL_connect(), SSL_accept(), SSL_do_handshake(), SSL_read_ex(), SSL_read(), SSL_peek_ex(), SSL_peek(), SSL_shutdown(), SSL_write_ex() or SSL_write() on ssl. Int SSL_get_error(const SSL *ssl, int ret) SSL_get_error - obtain result code for TLS/SSL I/O operation ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |