tfSslServerUserHelloRequest
Table of Contents >> SSL Programmer's Reference
| #include <trsocket.h> |
| int tfSslServerUserHelloRequest | ( |
| int socketDescriptor, | |
| int option | |
| ); |
Function Description
tfSslServerUserHelloRequest() is used to trigger SSL rehandshaking. SSL server sends HelloRequest to SSL client. Upon receiving HelloRequest, the SSL client should start SSL renegotiation. A common scenario is that: SSL client/server has negotiated a normal connection. Later, when SSL server determines that mutual authentication is necessary, then SSL server requests the client to start a new connection negotiation with mutual authentication. Upon receiving HelloRequest, the SSL client should start a brand new SSL negotiation under the protection of the previous established SSL channel.
Parameters
- socketDescriptor
- Socket descriptor
- options
- Rehandshake options. Currently, we only support option TM_SSL_OPT_CLIENTAUTH or nothing. If TM_SSL_OPT_CLIENTAUTH option is set, the new handshake will require client authentication.
Returns
- Non-negative
- Success.
- TM_SOCKET_ERROR
- Failure.
| TM_SOCKET_ERROR means that this socket call has failed and the errorCode has been set on the socket itself.
To retrieve the socket error the user must call tfGetSocketError(socketDescriptor). |
Possible socket errors
- TM_ENOBUFS
- No more buffer available
- TM_EPERM
- Function call not permitted, check if TM_TCP_SSLSESSION and TM_TCP_SSL_SERVER are both set on this socket. And previous SSL connection should be established.
- TM_EPROTONOTSUPPORT
- The socket is not TCP socket
- TM_EBADF
- Socket pointer is not found
- TM_EOPNOTSUPP
- Option not supported.