1SSL_CTX_set_mode(3)                 OpenSSL                SSL_CTX_set_mode(3)
2
3
4

NAME

6       SSL_CTX_set_mode, SSL_set_mode, SSL_CTX_get_mode, SSL_get_mode -
7       manipulate SSL engine mode
8

SYNOPSIS

10        #include <openssl/ssl.h>
11
12        long SSL_CTX_set_mode(SSL_CTX *ctx, long mode);
13        long SSL_set_mode(SSL *ssl, long mode);
14
15        long SSL_CTX_get_mode(SSL_CTX *ctx);
16        long SSL_get_mode(SSL *ssl);
17

DESCRIPTION

19       SSL_CTX_set_mode() adds the mode set via bitmask in mode to ctx.
20       Options already set before are not cleared.
21
22       SSL_set_mode() adds the mode set via bitmask in mode to ssl.  Options
23       already set before are not cleared.
24
25       SSL_CTX_get_mode() returns the mode set for ctx.
26
27       SSL_get_mode() returns the mode set for ssl.
28

NOTES

30       The following mode changes are available:
31
32       SSL_MODE_ENABLE_PARTIAL_WRITE
33           Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report
34           success when just a single record has been written). When not set
35           (the default), SSL_write() will only report success once the
36           complete chunk was written.  Once SSL_write() returns with r, r
37           bytes have been successfully written and the next call to
38           SSL_write() must only send the n-r bytes left, imitating the
39           behaviour of write().
40
41       SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
42           Make it possible to retry SSL_write() with changed buffer location
43           (the buffer contents must stay the same). This is not the default
44           to avoid the misconception that non-blocking SSL_write() behaves
45           like non-blocking write().
46
47       SSL_MODE_AUTO_RETRY
48           Never bother the application with retries if the transport is
49           blocking.  If a renegotiation take place during normal operation, a
50           SSL_read(3) or SSL_write(3) would return with -1 and indicate the
51           need to retry with SSL_ERROR_WANT_READ.  In a non-blocking
52           environment applications must be prepared to handle incomplete
53           read/write operations.  In a blocking environment, applications are
54           not always prepared to deal with read/write operations returning
55           without success report. The flag SSL_MODE_AUTO_RETRY will cause
56           read/write operations to only return after the handshake and
57           successful completion.
58
59       SSL_MODE_RELEASE_BUFFERS
60           When we no longer need a read buffer or a write buffer for a given
61           SSL, then release the memory we were using to hold it.  Released
62           memory is either appended to a list of unused RAM chunks on the
63           SSL_CTX, or simply freed if the list of unused chunks would become
64           longer than SSL_CTX->freelist_max_len, which defaults to 32.  Using
65           this flag can save around 34k per idle SSL connection.  This flag
66           has no effect on SSL v2 connections, or on DTLS connections.
67
68       SSL_MODE_SEND_FALLBACK_SCSV
69           Send TLS_FALLBACK_SCSV in the ClientHello.  To be set only by
70           applications that reconnect with a downgraded protocol version; see
71           draft-ietf-tls-downgrade-scsv-00 for details.
72
73           DO NOT ENABLE THIS if your application attempts a normal handshake.
74           Only use this in explicit fallback retries, following the guidance
75           in draft-ietf-tls-downgrade-scsv-00.
76

RETURN VALUES

78       SSL_CTX_set_mode() and SSL_set_mode() return the new mode bitmask after
79       adding mode.
80
81       SSL_CTX_get_mode() and SSL_get_mode() return the current bitmask.
82

SEE ALSO

84       ssl(3), SSL_read(3), SSL_write(3)
85

HISTORY

87       SSL_MODE_AUTO_RETRY as been added in OpenSSL 0.9.6.
88
89
90
911.0.2k                            2017-01-26               SSL_CTX_set_mode(3)
Impressum