setRequireCloseNotify

open fun setRequireCloseNotify(requireCloseNotify: Boolean)

Sets whether or not @conn expects a proper TLS close notification before the connection is closed. If this is true (the default), then @conn will expect to receive a TLS close notification from its peer before the connection is closed, and will return a %G_TLS_ERROR_EOF error if the connection is closed without proper notification (since this may indicate a network error, or man-in-the-middle attack).

In some protocols, the application will know whether or not the connection was closed cleanly based on application-level data (because the application-level data includes a length field, or is somehow self-delimiting); in this case, the close notify is redundant and may be omitted. You can use g_dtls_connection_set_require_close_notify() to tell @conn to allow an "unannounced" connection close, in which case the close will show up as a 0-length read, as in a non-TLS #GDatagramBased, and it is up to the application to check that the data has been fully received.

Note that this only affects the behavior when the peer closes the connection; when the application calls g_dtls_connection_close_async() on

Since

2.48

Parameters

requireCloseNotify

whether or not to require close notification