diff options
Diffstat (limited to 'src/lib/libssl/man/SSL_clear.3')
| -rw-r--r-- | src/lib/libssl/man/SSL_clear.3 | 92 |
1 files changed, 92 insertions, 0 deletions
diff --git a/src/lib/libssl/man/SSL_clear.3 b/src/lib/libssl/man/SSL_clear.3 new file mode 100644 index 0000000000..a9e318320f --- /dev/null +++ b/src/lib/libssl/man/SSL_clear.3 | |||
| @@ -0,0 +1,92 @@ | |||
| 1 | .\" | ||
| 2 | .\" $OpenBSD: SSL_clear.3,v 1.1 2016/11/05 15:32:20 schwarze Exp $ | ||
| 3 | .\" | ||
| 4 | .Dd $Mdocdate: November 5 2016 $ | ||
| 5 | .Dt SSL_CLEAR 3 | ||
| 6 | .Os | ||
| 7 | .Sh NAME | ||
| 8 | .Nm SSL_clear | ||
| 9 | .Nd reset SSL object to allow another connection | ||
| 10 | .Sh SYNOPSIS | ||
| 11 | .In openssl/ssl.h | ||
| 12 | .Ft int | ||
| 13 | .Fn SSL_clear "SSL *ssl" | ||
| 14 | .Sh DESCRIPTION | ||
| 15 | Reset | ||
| 16 | .Fa ssl | ||
| 17 | to allow another connection. | ||
| 18 | All settings (method, ciphers, BIOs) are kept. | ||
| 19 | .Sh NOTES | ||
| 20 | .Fn SSL_clear | ||
| 21 | is used to prepare an | ||
| 22 | .Vt SSL | ||
| 23 | object for a new connection. | ||
| 24 | While all settings are kept, | ||
| 25 | a side effect is the handling of the current SSL session. | ||
| 26 | If a session is still | ||
| 27 | .Em open , | ||
| 28 | it is considered bad and will be removed from the session cache, | ||
| 29 | as required by RFC2246. | ||
| 30 | A session is considered open if | ||
| 31 | .Xr SSL_shutdown 3 | ||
| 32 | was not called for the connection or at least | ||
| 33 | .Xr SSL_set_shutdown 3 | ||
| 34 | was used to | ||
| 35 | set the | ||
| 36 | .Dv SSL_SENT_SHUTDOWN | ||
| 37 | state. | ||
| 38 | .Pp | ||
| 39 | If a session was closed cleanly, | ||
| 40 | the session object will be kept and all settings corresponding. | ||
| 41 | This explicitly means that for example the special method used during the | ||
| 42 | session will be kept for the next handshake. | ||
| 43 | So if the session was a TLSv1 session, a | ||
| 44 | .Vt SSL | ||
| 45 | client object will use a TLSv1 client method for the next handshake and a | ||
| 46 | .Vt SSL | ||
| 47 | server object will use a TLSv1 server method, even if | ||
| 48 | .Fn SSLv23_*_method Ns s | ||
| 49 | were chosen on startup. | ||
| 50 | This might lead to connection failures (see | ||
| 51 | .Xr SSL_new 3 ) | ||
| 52 | for a description of the method's properties. | ||
| 53 | .Sh WARNINGS | ||
| 54 | .Fn SSL_clear | ||
| 55 | resets the | ||
| 56 | .Vt SSL | ||
| 57 | object to allow for another connection. | ||
| 58 | The reset operation however keeps several settings of the last sessions | ||
| 59 | (some of these settings were made automatically during the last handshake). | ||
| 60 | It only makes sense for a new connection with the exact same peer that shares | ||
| 61 | these settings, | ||
| 62 | and may fail if that peer changes its settings between connections. | ||
| 63 | Use the sequence | ||
| 64 | .Xr SSL_get_session 3 ; | ||
| 65 | .Xr SSL_new 3 ; | ||
| 66 | .Xr SSL_set_session 3 ; | ||
| 67 | .Xr SSL_free 3 | ||
| 68 | instead to avoid such failures (or simply | ||
| 69 | .Xr SSL_free 3 ; | ||
| 70 | .Xr SSL_new 3 | ||
| 71 | if session reuse is not desired). | ||
| 72 | .Sh RETURN VALUES | ||
| 73 | The following return values can occur: | ||
| 74 | .Bl -tag -width Ds | ||
| 75 | .It 0 | ||
| 76 | The | ||
| 77 | .Fn SSL_clear | ||
| 78 | operation could not be performed. | ||
| 79 | Check the error stack to find out the reason. | ||
| 80 | .It 1 | ||
| 81 | The | ||
| 82 | .Fn SSL_clear | ||
| 83 | operation was successful. | ||
| 84 | .El | ||
| 85 | .Sh SEE ALSO | ||
| 86 | .Xr ssl 3 , | ||
| 87 | .Xr SSL_CTX_set_client_cert_cb 3 , | ||
| 88 | .Xr SSL_CTX_set_options 3 , | ||
| 89 | .Xr SSL_free 3 , | ||
| 90 | .Xr SSL_new 3 , | ||
| 91 | .Xr SSL_set_shutdown 3 , | ||
| 92 | .Xr SSL_shutdown 3 | ||
