| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
@deftypefun {int} {gnutls_rehandshake} (gnutls_session_t @var{session}) |
| 6 |
@var{session}: is a @code{gnutls_session_t} type. |
| 7 |
|
| 8 |
This function can only be called in server side, and |
| 9 |
instructs a TLS 1.2 or earlier client to renegotiate |
| 10 |
parameters (perform a handshake), by sending a |
| 11 |
hello request message. |
| 12 |
|
| 13 |
If this function succeeds, the calling application |
| 14 |
should call @code{gnutls_record_recv()} until @code{GNUTLS_E_REHANDSHAKE} |
| 15 |
is returned to clear any pending data. If the @code{GNUTLS_E_REHANDSHAKE} |
| 16 |
error code is not seen, then the handshake request was |
| 17 |
not followed by the peer (the TLS protocol does not require |
| 18 |
the client to do, and such compliance should be handled |
| 19 |
by the application protocol). |
| 20 |
|
| 21 |
Once the @code{GNUTLS_E_REHANDSHAKE} error code is seen, the |
| 22 |
calling application should proceed to calling |
| 23 |
@code{gnutls_handshake()} to negotiate the new |
| 24 |
parameters. |
| 25 |
|
| 26 |
If the client does not wish to renegotiate parameters he |
| 27 |
may reply with an alert message, and in that case the return code seen |
| 28 |
by subsequent @code{gnutls_record_recv()} will be |
| 29 |
@code{GNUTLS_E_WARNING_ALERT_RECEIVED} with the specific alert being |
| 30 |
@code{GNUTLS_A_NO_RENEGOTIATION} . A client may also choose to ignore |
| 31 |
this request. |
| 32 |
|
| 33 |
Under TLS 1.3 this function is equivalent to @code{gnutls_session_key_update()} |
| 34 |
with the @code{GNUTLS_KU_PEER} flag. In that case subsequent calls to |
| 35 |
@code{gnutls_record_recv()} will not return @code{GNUTLS_E_REHANDSHAKE} , and |
| 36 |
calls to @code{gnutls_handshake()} in server side are a no-op. |
| 37 |
|
| 38 |
This function always fails with @code{GNUTLS_E_INVALID_REQUEST} when |
| 39 |
called in client side. |
| 40 |
|
| 41 |
@strong{Returns:} @code{GNUTLS_E_SUCCESS} on success, otherwise a negative error code. |
| 42 |
@end deftypefun |