SSL_CTX_set_mode.pod revision 76866
1=pod
2
3=head1 NAME
4
5SSL_CTX_set_mode, SSL_set_mode, SSL_CTX_get_mode, SSL_get_mode - manipulate SSL engine mode
6
7=head1 SYNOPSIS
8
9 #include <openssl/ssl.h>
10
11 long SSL_CTX_set_mode(SSL_CTX *ctx, long mode);
12 long SSL_set_mode(SSL *ssl, long mode);
13
14 long SSL_CTX_get_mode(SSL_CTX *ctx);
15 long SSL_get_mode(SSL *ssl);
16
17=head1 DESCRIPTION
18
19SSL_CTX_set_mode() adds the mode set via bitmask in B<mode> to B<ctx>.
20Options already set before are not cleared.
21
22SSL_set_mode() adds the mode set via bitmask in B<mode> to B<ssl>.
23Options already set before are not cleared.
24
25SSL_CTX_get_mode() returns the mode set for B<ctx>.
26
27SSL_get_mode() returns the mode set for B<ssl>.
28
29=head1 NOTES
30
31The following mode changes are available:
32
33=over 4
34
35=item SSL_MODE_ENABLE_PARTIAL_WRITE
36
37Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
38when just a single record has been written). When not set (the default),
39SSL_write() will only report success once the complete chunk was written.
40
41=item SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
42
43Make 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
45the misconception that non-blocking SSL_write() behaves like
46non-blocking write().
47
48=item SSL_MODE_AUTO_RETRY
49
50Never bother the application with retries if the transport is blocking.
51If a renegotiation take place during normal operation, a
52L<SSL_read(3)|SSL_read(3)> or L<SSL_write(3)|SSL_write(3)> would return
53with -1 and indicate the need to retry with SSL_ERROR_WANT_READ.
54In a non-blocking environment applications must be prepared to handle
55incomplete read/write operations.
56In a blocking environment, applications are not always prepared to
57deal with read/write operations returning without success report. The
58flag SSL_MODE_AUTO_RETRY will cause read/write operations to only
59return after the handshake and successful completion.
60
61=back
62
63=head1 RETURN VALUES
64
65SSL_CTX_set_mode() and SSL_set_mode() return the new mode bitmask
66after adding B<mode>.
67
68SSL_CTX_get_mode() and SSL_get_mode() return the current bitmask.
69
70=head1 SEE ALSO
71
72L<ssl(3)|ssl(3)>, L<SSL_read(3)|SSL_read(3)>, L<SSL_write(3)|SSL_write(3)>
73
74=head1 HISTORY
75
76SSL_MODE_AUTO_RETRY as been added in OpenSSL 0.9.6.
77
78=cut
79