1*2175Sjp161948=pod 2*2175Sjp161948 3*2175Sjp161948=head1 NAME 4*2175Sjp161948 5*2175Sjp161948SSL_set_connect_state, SSL_get_accept_state - prepare SSL object to work in client or server mode 6*2175Sjp161948 7*2175Sjp161948=head1 SYNOPSIS 8*2175Sjp161948 9*2175Sjp161948 #include <openssl/ssl.h> 10*2175Sjp161948 11*2175Sjp161948 void SSL_set_connect_state(SSL *ssl); 12*2175Sjp161948 13*2175Sjp161948 void SSL_set_accept_state(SSL *ssl); 14*2175Sjp161948 15*2175Sjp161948=head1 DESCRIPTION 16*2175Sjp161948 17*2175Sjp161948SSL_set_connect_state() sets B<ssl> to work in client mode. 18*2175Sjp161948 19*2175Sjp161948SSL_set_accept_state() sets B<ssl> to work in server mode. 20*2175Sjp161948 21*2175Sjp161948=head1 NOTES 22*2175Sjp161948 23*2175Sjp161948When the SSL_CTX object was created with L<SSL_CTX_new(3)|SSL_CTX_new(3)>, 24*2175Sjp161948it was either assigned a dedicated client method, a dedicated server 25*2175Sjp161948method, or a generic method, that can be used for both client and 26*2175Sjp161948server connections. (The method might have been changed with 27*2175Sjp161948L<SSL_CTX_set_ssl_version(3)|SSL_CTX_set_ssl_version(3)> or 28*2175Sjp161948SSL_set_ssl_method().) 29*2175Sjp161948 30*2175Sjp161948When beginning a new handshake, the SSL engine must know whether it must 31*2175Sjp161948call the connect (client) or accept (server) routines. Even though it may 32*2175Sjp161948be clear from the method chosen, whether client or server mode was 33*2175Sjp161948requested, the handshake routines must be explicitly set. 34*2175Sjp161948 35*2175Sjp161948When using the L<SSL_connect(3)|SSL_connect(3)> or 36*2175Sjp161948L<SSL_accept(3)|SSL_accept(3)> routines, the correct handshake 37*2175Sjp161948routines are automatically set. When performing a transparent negotiation 38*2175Sjp161948using L<SSL_write(3)|SSL_write(3)> or L<SSL_read(3)|SSL_read(3)>, the 39*2175Sjp161948handshake routines must be explicitly set in advance using either 40*2175Sjp161948SSL_set_connect_state() or SSL_set_accept_state(). 41*2175Sjp161948 42*2175Sjp161948=head1 RETURN VALUES 43*2175Sjp161948 44*2175Sjp161948SSL_set_connect_state() and SSL_set_accept_state() do not return diagnostic 45*2175Sjp161948information. 46*2175Sjp161948 47*2175Sjp161948=head1 SEE ALSO 48*2175Sjp161948 49*2175Sjp161948L<ssl(3)|ssl(3)>, L<SSL_new(3)|SSL_new(3)>, L<SSL_CTX_new(3)|SSL_CTX_new(3)>, 50*2175Sjp161948L<SSL_connect(3)|SSL_connect(3)>, L<SSL_accept(3)|SSL_accept(3)>, 51*2175Sjp161948L<SSL_write(3)|SSL_write(3)>, L<SSL_read(3)|SSL_read(3)>, 52*2175Sjp161948L<SSL_do_handshake(3)|SSL_do_handshake(3)>, 53*2175Sjp161948L<SSL_CTX_set_ssl_version(3)|SSL_CTX_set_ssl_version(3)> 54*2175Sjp161948 55*2175Sjp161948=cut 56