SSL_CTX_set_mode.pod revision 89837
176866Skris=pod 276866Skris 376866Skris=head1 NAME 476866Skris 576866SkrisSSL_CTX_set_mode, SSL_set_mode, SSL_CTX_get_mode, SSL_get_mode - manipulate SSL engine mode 676866Skris 776866Skris=head1 SYNOPSIS 876866Skris 976866Skris #include <openssl/ssl.h> 1076866Skris 1176866Skris long SSL_CTX_set_mode(SSL_CTX *ctx, long mode); 1276866Skris long SSL_set_mode(SSL *ssl, long mode); 1376866Skris 1476866Skris long SSL_CTX_get_mode(SSL_CTX *ctx); 1576866Skris long SSL_get_mode(SSL *ssl); 1676866Skris 1776866Skris=head1 DESCRIPTION 1876866Skris 1976866SkrisSSL_CTX_set_mode() adds the mode set via bitmask in B<mode> to B<ctx>. 2076866SkrisOptions already set before are not cleared. 2176866Skris 2276866SkrisSSL_set_mode() adds the mode set via bitmask in B<mode> to B<ssl>. 2376866SkrisOptions already set before are not cleared. 2476866Skris 2576866SkrisSSL_CTX_get_mode() returns the mode set for B<ctx>. 2676866Skris 2776866SkrisSSL_get_mode() returns the mode set for B<ssl>. 2876866Skris 2976866Skris=head1 NOTES 3076866Skris 3176866SkrisThe following mode changes are available: 3276866Skris 3376866Skris=over 4 3476866Skris 3576866Skris=item SSL_MODE_ENABLE_PARTIAL_WRITE 3676866Skris 3776866SkrisAllow SSL_write(..., n) to return r with 0 < r < n (i.e. report success 3876866Skriswhen just a single record has been written). When not set (the default), 3976866SkrisSSL_write() will only report success once the complete chunk was written. 4089837SkrisOnce SSL_write() returns with r, r bytes have been successfully written 4189837Skrisand the next call to SSL_write() must only send the n-r bytes left, 4289837Skrisimitating the behaviour of write(). 4376866Skris 4476866Skris=item SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 4576866Skris 4676866SkrisMake it possible to retry SSL_write() with changed buffer location 4776866Skris(the buffer contents must stay the same). This is not the default to avoid 4876866Skristhe misconception that non-blocking SSL_write() behaves like 4976866Skrisnon-blocking write(). 5076866Skris 5176866Skris=item SSL_MODE_AUTO_RETRY 5276866Skris 5376866SkrisNever bother the application with retries if the transport is blocking. 5476866SkrisIf a renegotiation take place during normal operation, a 5576866SkrisL<SSL_read(3)|SSL_read(3)> or L<SSL_write(3)|SSL_write(3)> would return 5676866Skriswith -1 and indicate the need to retry with SSL_ERROR_WANT_READ. 5776866SkrisIn a non-blocking environment applications must be prepared to handle 5876866Skrisincomplete read/write operations. 5976866SkrisIn a blocking environment, applications are not always prepared to 6076866Skrisdeal with read/write operations returning without success report. The 6176866Skrisflag SSL_MODE_AUTO_RETRY will cause read/write operations to only 6276866Skrisreturn after the handshake and successful completion. 6376866Skris 6476866Skris=back 6576866Skris 6676866Skris=head1 RETURN VALUES 6776866Skris 6876866SkrisSSL_CTX_set_mode() and SSL_set_mode() return the new mode bitmask 6976866Skrisafter adding B<mode>. 7076866Skris 7176866SkrisSSL_CTX_get_mode() and SSL_get_mode() return the current bitmask. 7276866Skris 7376866Skris=head1 SEE ALSO 7476866Skris 7576866SkrisL<ssl(3)|ssl(3)>, L<SSL_read(3)|SSL_read(3)>, L<SSL_write(3)|SSL_write(3)> 7676866Skris 7776866Skris=head1 HISTORY 7876866Skris 7976866SkrisSSL_MODE_AUTO_RETRY as been added in OpenSSL 0.9.6. 8076866Skris 8176866Skris=cut 82