⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ssl_get_error.pod

📁 With OpenSSL 0.9.6, a new component has been added to support external crypto devices, for example a
💻 POD
字号:
=pod=head1 NAMESSL_get_error - obtain result code for TLS/SSL I/O operation=head1 SYNOPSIS #include <openssl/ssl.h> int SSL_get_error(SSL *ssl, int ret);=head1 DESCRIPTIONSSL_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(), SSL_peek(), or SSL_write() on B<ssl>.  The value returned bythat TLS/SSL I/O function must be passed to SSL_get_error() in parameterB<ret>.In addition to B<ssl> and B<ret>, SSL_get_error() inspects thecurrent thread's OpenSSL error queue.  Thus, SSL_get_error() must beused in the same thread that performed the TLS/SSL I/O operation, and noother OpenSSL function calls should appear in between.  The currentthread's error queue must be empty before the TLS/SSL I/O operation isattempted, or SSL_get_error() will not work reliably.=head1 RETURN VALUESThe following return values can currently occur:=over 4=item SSL_ERROR_NONEThe TLS/SSL I/O operation completed.  This result code is returnedif and only if B<ret E<gt> 0>.=item SSL_ERROR_ZERO_RETURNThe TLS/SSL connection has been closed.  If the protocol version is SSL 3.0or TLS 1.0, this result code is returned only if a closurealert has occurred in the protocol, i.e. if the connection has beenclosed cleanly. Note that in this case B<SSL_ERROR_ZERO_RETURN>does not necessarily indicate that the underlying transporthas been closed.=item SSL_ERROR_WANT_READ, SSL_ERROR_WANT_WRITEThe operation did not complete; the same TLS/SSL I/O function should becalled again later.  If, by then, the underlying B<BIO> has dataavailable for reading (if the result code is B<SSL_ERROR_WANT_READ>)or allows writing data (B<SSL_ERROR_WANT_WRITE>), then some TLS/SSLprotocol progress will take place, i.e. at least part of an TLS/SSLrecord will be read or written.  Note that the retry may again lead toa B<SSL_ERROR_WANT_READ> or B<SSL_ERROR_WANT_WRITE> condition.There is no fixed upper limit for the number of iterations thatmay be necessary until progress becomes visible at applicationprotocol level.For socket B<BIO>s (e.g. when SSL_set_fd() was used), select() orpoll() on the underlying socket can be used to find out when theTLS/SSL I/O function should be retried.Caveat: Any TLS/SSL I/O function can lead to either ofB<SSL_ERROR_WANT_READ> and B<SSL_ERROR_WANT_WRITE>.  In particular,SSL_read() or SSL_peek() may want to write data and SSL_write() may wantto read data.  This is mainly because TLS/SSL handshakes may occur at anytime during the protocol (initiated by either the client or the server);SSL_read(), SSL_peek(), and SSL_write() will handle any pending handshakes.=item SSL_ERROR_WANT_CONNECT, SSL_ERROR_WANT_ACCEPTThe operation did not complete; the same TLS/SSL I/O function should becalled again later. The underlying BIO was not connected yet to the peerand the call would block in connect()/accept(). The SSL function should becalled again when the connection is established. These messages can onlyappear with a BIO_s_connect() or BIO_s_accept() BIO, respectively.In order to find out, when the connection has been successfully established,on many platforms select() or poll() for writing on the socket file descriptorcan be used.=item SSL_ERROR_WANT_X509_LOOKUPThe operation did not complete because an application callback set bySSL_CTX_set_client_cert_cb() has asked to be called again.The TLS/SSL I/O function should be called again later.Details depend on the application.=item SSL_ERROR_SYSCALLSome I/O error occurred.  The OpenSSL error queue may contain moreinformation on the error.  If the error queue is empty(i.e. ERR_get_error() returns 0), B<ret> can be used to find out moreabout the error: If B<ret == 0>, an EOF was observed that violatesthe protocol.  If B<ret == -1>, the underlying B<BIO> reported anI/O error (for socket I/O on Unix systems, consult B<errno> for details).=item SSL_ERROR_SSLA failure in the SSL library occurred, usually a protocol error.  TheOpenSSL error queue contains more information on the error.=back=head1 SEE ALSOL<ssl(3)|ssl(3)>, L<err(3)|err(3)>=head1 HISTORYSSL_get_error() was added in SSLeay 0.8.=cut

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -