5 SSL_CTX_set_mode, SSL_set_mode, SSL_CTX_get_mode, SSL_get_mode - manipulate SSL engine mode
9 #include <openssl/ssl.h>
11 long SSL_CTX_set_mode(SSL_CTX *ctx, long mode);
12 long SSL_set_mode(SSL *ssl, long mode);
14 long SSL_CTX_get_mode(SSL_CTX *ctx);
15 long SSL_get_mode(SSL *ssl);
19 SSL_CTX_set_mode() adds the mode set via bitmask in B<mode> to B<ctx>.
20 Options already set before are not cleared.
22 SSL_set_mode() adds the mode set via bitmask in B<mode> to B<ssl>.
23 Options already set before are not cleared.
25 SSL_CTX_get_mode() returns the mode set for B<ctx>.
27 SSL_get_mode() returns the mode set for B<ssl>.
31 The following mode changes are available:
35 =item SSL_MODE_ENABLE_PARTIAL_WRITE
37 Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
38 when just a single record has been written). When not set (the default),
39 SSL_write() will only report success once the complete chunk was written.
41 =item SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
43 Make it possible to retry SSL_write() with changed buffer location
44 (the buffer contents must stay the same). This is not the default to avoid
45 the misconception that non-blocking SSL_write() behaves like
48 =item SSL_MODE_AUTO_RETRY
50 Never bother the application with retries if the transport is blocking.
51 If a renegotiation take place during normal operation, a
52 L<SSL_read(3)|SSL_read(3)> or L<SSL_write(3)|SSL_write(3)> would return
53 with -1 and indicate the need to retry with SSL_ERROR_WANT_READ.
54 In a non-blocking environment applications must be prepared to handle
55 incomplete read/write operations.
56 In a blocking environment, applications are not always prepared to
57 deal with read/write operations returning without success report. The
58 flag SSL_MODE_AUTO_RETRY will cause read/write operations to only
59 return after the handshake and successful completion.
65 SSL_CTX_set_mode() and SSL_set_mode() return the new mode bitmask
68 SSL_CTX_get_mode() and SSL_get_mode() return the current bitmask.
72 L<ssl(3)|ssl(3)>, L<SSL_read(3)|SSL_read(3)>, L<SSL_write(3)|SSL_write(3)>
76 SSL_MODE_AUTO_RETRY as been added in OpenSSL 0.9.6.