SSL_CTX_set_mode.pod revision 76866
1103856Stjr=pod
2103856Stjr
3103856Stjr=head1 NAME
4103856Stjr
5103856StjrSSL_CTX_set_mode, SSL_set_mode, SSL_CTX_get_mode, SSL_get_mode - manipulate SSL engine mode
6103856Stjr
7103856Stjr=head1 SYNOPSIS
8103856Stjr
9103856Stjr #include <openssl/ssl.h>
10103856Stjr
11103856Stjr long SSL_CTX_set_mode(SSL_CTX *ctx, long mode);
12103856Stjr long SSL_set_mode(SSL *ssl, long mode);
13103856Stjr
14103856Stjr long SSL_CTX_get_mode(SSL_CTX *ctx);
15103856Stjr long SSL_get_mode(SSL *ssl);
16103856Stjr
17103856Stjr=head1 DESCRIPTION
18103856Stjr
19103856StjrSSL_CTX_set_mode() adds the mode set via bitmask in B<mode> to B<ctx>.
20103856StjrOptions already set before are not cleared.
21103856Stjr
22103856StjrSSL_set_mode() adds the mode set via bitmask in B<mode> to B<ssl>.
23103856StjrOptions already set before are not cleared.
24103856Stjr
25103856StjrSSL_CTX_get_mode() returns the mode set for B<ctx>.
26103856Stjr
27103856StjrSSL_get_mode() returns the mode set for B<ssl>.
28103856Stjr
29103856Stjr=head1 NOTES
30103856Stjr
31103856StjrThe following mode changes are available:
32103856Stjr
33103856Stjr=over 4
34103856Stjr
35103856Stjr=item SSL_MODE_ENABLE_PARTIAL_WRITE
36103856Stjr
37103856StjrAllow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
38128844Sobrienwhen just a single record has been written). When not set (the default),
39103856StjrSSL_write() will only report success once the complete chunk was written.
40103856Stjr
41103856Stjr=item SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
42103856Stjr
43103856StjrMake it possible to retry SSL_write() with changed buffer location
44149313Sstefanf(the buffer contents must stay the same). This is not the default to avoid
45103856Stjrthe misconception that non-blocking SSL_write() behaves like
46103856Stjrnon-blocking write().
47103856Stjr
48103856Stjr=item SSL_MODE_AUTO_RETRY
49103856Stjr
50103856StjrNever bother the application with retries if the transport is blocking.
51103856StjrIf a renegotiation take place during normal operation, a
52103856StjrL<SSL_read(3)|SSL_read(3)> or L<SSL_write(3)|SSL_write(3)> would return
53103856Stjrwith -1 and indicate the need to retry with SSL_ERROR_WANT_READ.
54103856StjrIn a non-blocking environment applications must be prepared to handle
55103856Stjrincomplete read/write operations.
56103856StjrIn a blocking environment, applications are not always prepared to
57128822Sdasdeal with read/write operations returning without success report. The
58103856Stjrflag SSL_MODE_AUTO_RETRY will cause read/write operations to only
59103856Stjrreturn after the handshake and successful completion.
60103856Stjr
61103856Stjr=back
62103856Stjr
63103856Stjr=head1 RETURN VALUES
64103856Stjr
65103856StjrSSL_CTX_set_mode() and SSL_set_mode() return the new mode bitmask
66103856Stjrafter adding B<mode>.
67103856Stjr
68103856StjrSSL_CTX_get_mode() and SSL_get_mode() return the current bitmask.
69103856Stjr
70103856Stjr=head1 SEE ALSO
71103856Stjr
72103856StjrL<ssl(3)|ssl(3)>, L<SSL_read(3)|SSL_read(3)>, L<SSL_write(3)|SSL_write(3)>
73103856Stjr
74103856Stjr=head1 HISTORY
75103856Stjr
76103856StjrSSL_MODE_AUTO_RETRY as been added in OpenSSL 0.9.6.
77103856Stjr
78103856Stjr=cut
79103856Stjr