summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_CTX_set_mode.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_mode.3')
-rw-r--r--src/lib/libssl/doc/SSL_CTX_set_mode.3123
1 files changed, 123 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_mode.3 b/src/lib/libssl/doc/SSL_CTX_set_mode.3
new file mode 100644
index 0000000000..b980d43dbe
--- /dev/null
+++ b/src/lib/libssl/doc/SSL_CTX_set_mode.3
@@ -0,0 +1,123 @@
1.Dd $Mdocdate: October 12 2014 $
2.Dt SSL_CTX_SET_MODE 3
3.Os
4.Sh NAME
5.Nm SSL_CTX_set_mode ,
6.Nm SSL_set_mode ,
7.Nm SSL_CTX_get_mode ,
8.Nm SSL_get_mode
9.Nd manipulate SSL engine mode
10.Sh SYNOPSIS
11.In openssl/ssl.h
12.Ft long
13.Fn SSL_CTX_set_mode "SSL_CTX *ctx" "long mode"
14.Ft long
15.Fn SSL_set_mode "SSL *ssl" "long mode"
16.Ft long
17.Fn SSL_CTX_get_mode "SSL_CTX *ctx"
18.Ft long
19.Fn SSL_get_mode "SSL *ssl"
20.Sh DESCRIPTION
21.Fn SSL_CTX_set_mode
22adds the mode set via bitmask in
23.Fa mode
24to
25.Fa ctx .
26Options already set before are not cleared.
27.Pp
28.Fn SSL_set_mode
29adds the mode set via bitmask in
30.Fa mode
31to
32.Fa ssl .
33Options already set before are not cleared.
34.Pp
35.Fn SSL_CTX_get_mode
36returns the mode set for
37.Fa ctx .
38.Pp
39.Fn SSL_get_mode
40returns the mode set for
41.Fa ssl .
42.Sh NOTES
43The following mode changes are available:
44.Bl -tag -width Ds
45.It Dv SSL_MODE_ENABLE_PARTIAL_WRITE
46Allow
47.Fn SSL_write ... n
48to return
49.Ms r
50with
51.EQ
520 < r < n
53.EN
54(i.e., report success when just a single record has been written).
55When not set (the default),
56.Xr SSL_write 3
57will only report success once the complete chunk was written.
58Once
59.Xr SSL_write 3
60returns with
61.Ms r ,
62.Ms r
63bytes have been successfully written and the next call to
64.Xr SSL_write 3
65must only send the
66.Ms n \(mi r
67bytes left, imitating the behaviour of
68.Xr write 2 .
69.It Dv SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
70Make it possible to retry
71.Xr SSL_write 3
72with changed buffer location (the buffer contents must stay the same).
73This is not the default to avoid the misconception that non-blocking
74.Xr SSL_write 3
75behaves like non-blocking
76.Xr write 2 .
77.It Dv SSL_MODE_AUTO_RETRY
78Never bother the application with retries if the transport is blocking.
79If a renegotiation take place during normal operation, a
80.Xr SSL_read 3
81or
82.Xr SSL_write 3
83would return
84with \(mi1 and indicate the need to retry with
85.Dv SSL_ERROR_WANT_READ .
86In a non-blocking environment applications must be prepared to handle
87incomplete read/write operations.
88In a blocking environment, applications are not always prepared to deal with
89read/write operations returning without success report.
90The flag
91.Dv SSL_MODE_AUTO_RETRY
92will cause read/write operations to only return after the handshake and
93successful completion.
94.It Dv SSL_MODE_RELEASE_BUFFERS
95When we no longer need a read buffer or a write buffer for a given
96.Vt SSL ,
97then release the memory we were using to hold it.
98Released memory is either appended to a list of unused RAM chunks on the
99.Vt SSL_CTX ,
100or simply freed if the list of unused chunks would become longer than
101.Va "SSL_CTX->freelist_max_len" ,
102which defaults to 32.
103Using this flag can save around 34k per idle SSL connection.
104This flag has no effect on SSL v2 connections, or on DTLS connections.
105.El
106.Sh RETURN VALUES
107.Fn SSL_CTX_set_mode
108and
109.Fn SSL_set_mode
110return the new mode bitmask after adding
111.Fa mode .
112.Pp
113.Fn SSL_CTX_get_mode
114and
115.Fn SSL_get_mode
116return the current bitmask.
117.Sh SEE ALSO
118.Xr ssl 3 ,
119.Xr SSL_read 3 ,
120.Xr SSL_write 3
121.Sh HISTORY
122.Dv SSL_MODE_AUTO_RETRY
123was added in OpenSSL 0.9.6.