NAME
SSLaccept - wait for a TLS/SSL client to initiate a TLS/SSL handshake
SYNOPSIS
#include
int SSLaccept(SSL *ssl);DESCRIPTION
SSLaccept() waits for a TLS/SSL client to initiate the TLS/SSL handshake. The communication channel must already have been set and assigned to the ssssll by setting an underlying BBIIOO. NNOOTTEESS The behaviour of SSLaccept() depends on the underlying BIO. If the underlying BIO is bblloocckkiinngg, SSLaccept() will only return once the handshake has been finished or an error occurred, except for SGC(Server Gated Cryptography). For SGC, SSLaccept() may return with -1,
but SSLgeterror() will yield SSSSLLEERRRROORRWWAANNTTRREEAADD//WWRRIITTEE and SSLaccept() should be called again.If the underlying BIO is nnoonn-bblloocckkiinngg, SSLaccept() will also return
when the underlying BIO could not satisfy the needs of SSLaccept() tocontinue the handshake, indicating the problem by the return value -1.
In this case a call to SSLgeterror() with the return value of SSLaccept() will yield SSSSLLEERRRROORRWWAANNTTRREEAADD or SSSSLLEERRRROORRWWAANNTTWWRRIITTEE. The calling process then must repeat the call after taking appropriate action to satisfy the needs of SSLaccept(). The action depends on theunderlying BIO. When using a non-blocking socket, nothing is to be
done, but select() can be used to check for the required condition. When using a buffering BIO, like a BIO pair, data must be written into or retrieved out of the BIO before being able to continue.RETURN VALUES
The following return values can occur: 1. The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been established. 2. The TLS/SSL handshake was not successful but was shut down controlled and by the specifications of the TLS/SSL protocol. Call SSLgeterror() with the return value rreett to find out the reason. 3. <0 The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of actionis need to continue the operation for non-blocking BIOs. Call
SSLgeterror() with the return value rreett to find out the reason.SEE ALSO
SSLgeterror(3), SSLconnect(3), SSLshutdown(3), ssl(3), bio(3), SSLsetconnectstate(3), SSLdohandshake(3), SSLCTXnew(3) PPOODD EERRRROORRSS e! The above document had some coding errors, which are explained bbeellooww:: Around line 52: You have '=item 0' instead of the expected '=item 2' Around line 58: Expected '=item 3'0.9.7l 2003-06-03 SSLaccept(3)