📄 ssl_connect.pod
字号:
=pod=head1 NAMESSL_connect - initiate the TLS/SSL handshake with an TLS/SSL server=head1 SYNOPSIS #include <openssl/ssl.h> int SSL_connect(SSL *ssl);=head1 DESCRIPTIONSSL_connect() initiates the TLS/SSL handshake with a server. The communicationchannel must already have been set and assigned to the B<ssl> by setting anunderlying B<BIO>.=head1 NOTESThe behaviour of SSL_connect() depends on the underlying BIO. If the underlying BIO is B<blocking>, SSL_connect() will only return once thehandshake has been finished or an error occurred.If the underlying BIO is B<non-blocking>, SSL_connect() will also returnwhen the underlying BIO could not satisfy the needs of SSL_connect()to continue the handshake, indicating the problem by the return value -1.In this case a call to SSL_get_error() with thereturn value of SSL_connect() will yield B<SSL_ERROR_WANT_READ> orB<SSL_ERROR_WANT_WRITE>. The calling process then must repeat the call aftertaking appropriate action to satisfy the needs of SSL_connect().The action depends on the underlying BIO. When using a non-blocking socket,nothing is to be done, but select() can be used to check for the requiredcondition. When using a buffering BIO, like a BIO pair, data must be writteninto or retrieved out of the BIO before being able to continue.=head1 RETURN VALUESThe following return values can occur:=over 4=item 1The TLS/SSL handshake was successfully completed, a TLS/SSL connection has beenestablished.=item 0The TLS/SSL handshake was not successful but was shut down controlled andby the specifications of the TLS/SSL protocol. Call SSL_get_error() with thereturn value B<ret> to find out the reason.=item E<lt>0The TLS/SSL handshake was not successful, because a fatal error occurred eitherat the protocol level or a connection failure occurred. The shutdown wasnot clean. It can also occur of action is need to continue the operationfor non-blocking BIOs. Call SSL_get_error() with the return value B<ret>to find out the reason.=back=head1 SEE ALSOL<SSL_get_error(3)|SSL_get_error(3)>, L<SSL_accept(3)|SSL_accept(3)>,L<SSL_shutdown(3)|SSL_shutdown(3)>, L<ssl(3)|ssl(3)>, L<bio(3)|bio(3)>,L<SSL_set_connect_state(3)|SSL_set_connect_state(3)>,L<SSL_do_handshake(3)|SSL_do_handshake(3)>,L<SSL_CTX_new(3)|SSL_CTX_new(3)>=cut
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -