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 - manip‐
7       ulate 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 com‐
36           plete chunk was written.  Once SSL_write() returns with r, r bytes
37           have been successfully written and the next call to SSL_write()
38           must only send the n-r bytes left, imitating the behaviour of
39           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 environ‐
52           ment applications must be prepared to handle incomplete read/write
53           operations.  In a blocking environment, applications are not always
54           prepared to deal with read/write operations returning without suc‐
55           cess report. The flag SSL_MODE_AUTO_RETRY will cause read/write
56           operations to only return after the handshake and successful com‐
57           pletion.
58

RETURN VALUES

60       SSL_CTX_set_mode() and SSL_set_mode() return the new mode bitmask after
61       adding mode.
62
63       SSL_CTX_get_mode() and SSL_get_mode() return the current bitmask.
64

SEE ALSO

66       ssl(3), SSL_read(3), SSL_write(3)
67

HISTORY

69       SSL_MODE_AUTO_RETRY as been added in OpenSSL 0.9.6.
70
71
72
730.9.8b                            2001-07-11               SSL_CTX_set_mode(3)
Impressum