133965Sjdp=pod 2218822Sdim 3218822Sdim=head1 NAME 433965Sjdp 5218822SdimSSL_set_connect_state, SSL_get_accept_state - prepare SSL object to work in client or server mode 633965Sjdp 7218822Sdim=head1 SYNOPSIS 8218822Sdim 9218822Sdim #include <openssl/ssl.h> 10218822Sdim 1133965Sjdp void SSL_set_connect_state(SSL *ssl); 12218822Sdim 13218822Sdim void SSL_set_accept_state(SSL *ssl); 14218822Sdim 15218822Sdim=head1 DESCRIPTION 1633965Sjdp 17218822SdimSSL_set_connect_state() sets B<ssl> to work in client mode. 18218822Sdim 19218822SdimSSL_set_accept_state() sets B<ssl> to work in server mode. 2033965Sjdp 2189857Sobrien=head1 NOTES 2233965Sjdp 2333965SjdpWhen the SSL_CTX object was created with L<SSL_CTX_new(3)|SSL_CTX_new(3)>, 2433965Sjdpit was either assigned a dedicated client method, a dedicated server 2533965Sjdpmethod, or a generic method, that can be used for both client and 2633965Sjdpserver connections. (The method might have been changed with 27218822SdimL<SSL_CTX_set_ssl_version(3)|SSL_CTX_set_ssl_version(3)> or 28218822SdimSSL_set_ssl_method().) 29218822Sdim 30218822SdimWhen beginning a new handshake, the SSL engine must know whether it must 31218822Sdimcall the connect (client) or accept (server) routines. Even though it may 32218822Sdimbe clear from the method chosen, whether client or server mode was 33218822Sdimrequested, the handshake routines must be explicitly set. 3433965Sjdp 3589857SobrienWhen using the L<SSL_connect(3)|SSL_connect(3)> or 3689857SobrienL<SSL_accept(3)|SSL_accept(3)> routines, the correct handshake 3789857Sobrienroutines are automatically set. When performing a transparent negotiation 3889857Sobrienusing L<SSL_write(3)|SSL_write(3)> or L<SSL_read(3)|SSL_read(3)>, the 3933965Sjdphandshake routines must be explicitly set in advance using either 4033965SjdpSSL_set_connect_state() or SSL_set_accept_state(). 4133965Sjdp 42218822Sdim=head1 RETURN VALUES 4333965Sjdp 4433965SjdpSSL_set_connect_state() and SSL_set_accept_state() do not return diagnostic 4533965Sjdpinformation. 4633965Sjdp 4733965Sjdp=head1 SEE ALSO 4833965Sjdp 4933965SjdpL<ssl(3)|ssl(3)>, L<SSL_new(3)|SSL_new(3)>, L<SSL_CTX_new(3)|SSL_CTX_new(3)>, 50130561SobrienL<SSL_connect(3)|SSL_connect(3)>, L<SSL_accept(3)|SSL_accept(3)>, 51218822SdimL<SSL_write(3)|SSL_write(3)>, L<SSL_read(3)|SSL_read(3)>, 5233965SjdpL<SSL_do_handshake(3)|SSL_do_handshake(3)>, 5333965SjdpL<SSL_CTX_set_ssl_version(3)|SSL_CTX_set_ssl_version(3)> 5433965Sjdp 5533965Sjdp=cut 5633965Sjdp