1SSL_SET_CONNECT_STATE(3)            OpenSSL           SSL_SET_CONNECT_STATE(3)
2
3
4

NAME

6       SSL_set_connect_state, SSL_set_accept_state, SSL_is_server - functions
7       for manipulating and examining the client or server mode of an SSL
8       object
9

SYNOPSIS

11        #include <openssl/ssl.h>
12
13        void SSL_set_connect_state(SSL *ssl);
14
15        void SSL_set_accept_state(SSL *ssl);
16
17        int SSL_is_server(const SSL *ssl);
18

DESCRIPTION

20       SSL_set_connect_state() sets ssl to work in client mode.
21
22       SSL_set_accept_state() sets ssl to work in server mode.
23
24       SSL_is_server() checks if ssl is working in server mode.
25

NOTES

27       When the SSL_CTX object was created with SSL_CTX_new(3), it was either
28       assigned a dedicated client method, a dedicated server method, or a
29       generic method, that can be used for both client and server
30       connections. (The method might have been changed with
31       SSL_CTX_set_ssl_version(3) or SSL_set_ssl_method(3).)
32
33       When beginning a new handshake, the SSL engine must know whether it
34       must call the connect (client) or accept (server) routines. Even though
35       it may be clear from the method chosen, whether client or server mode
36       was requested, the handshake routines must be explicitly set.
37
38       When using the SSL_connect(3) or SSL_accept(3) routines, the correct
39       handshake routines are automatically set. When performing a transparent
40       negotiation using SSL_write_ex(3), SSL_write(3), SSL_read_ex(3), or
41       SSL_read(3), the handshake routines must be explicitly set in advance
42       using either SSL_set_connect_state() or SSL_set_accept_state().
43
44       If SSL_is_server() is called before SSL_set_connect_state() or
45       SSL_set_accept_state() is called (either automatically or explicitly),
46       the result depends on what method was used when SSL_CTX was created
47       with SSL_CTX_new(3). If a generic method or a dedicated server method
48       was passed to SSL_CTX_new(3), SSL_is_server() returns 1; otherwise, it
49       returns 0.
50

RETURN VALUES

52       SSL_set_connect_state() and SSL_set_accept_state() do not return
53       diagnostic information.
54
55       SSL_is_server() returns 1 if ssl is working in server mode or 0 for
56       client mode.
57

SEE ALSO

59       ssl(7), SSL_new(3), SSL_CTX_new(3), SSL_connect(3), SSL_accept(3),
60       SSL_write_ex(3), SSL_write(3), SSL_read_ex(3), SSL_read(3),
61       SSL_do_handshake(3), SSL_CTX_set_ssl_version(3)
62
64       Copyright 2001-2017 The OpenSSL Project Authors. All Rights Reserved.
65
66       Licensed under the OpenSSL license (the "License").  You may not use
67       this file except in compliance with the License.  You can obtain a copy
68       in the file LICENSE in the source distribution or at
69       <https://www.openssl.org/source/license.html>.
70
71
72
731.1.1d                            2019-10-03          SSL_SET_CONNECT_STATE(3)
Impressum