---
name: "SSL_get_accept_state"
section: "3ssl"
platform: "linux"
package: "libssl-doc"
version: "1.0.1t-1+deb8u8"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://carta.tech/man/SSL_set_connect_state"
---

# SSL\_get\_accept\_state(3ssl)

prepare SSL object to work in client or server mode

Part of [SSL\_set\_connect\_state(3ssl)](/man/SSL_set_connect_state/3ssl.md).

## NAME

SSL\_set\_connect\_state, SSL\_get\_accept\_state - prepare SSL object to work in client or server mode

## SYNOPSIS

```
 #include <openssl/ssl.h>
 void SSL_set_connect_state(SSL *ssl);
 void SSL_set_accept_state(SSL *ssl);
```

## DESCRIPTION

*SSL\_set\_connect\_state()* sets **ssl** to work in client mode.

*SSL\_set\_accept\_state()* sets **ssl** to work in server mode.

## NOTES

When the SSL\_CTX object was created with *SSL\_CTX\_new*(3), it was either assigned a dedicated client method, a dedicated server method, or a generic method, that can be used for both client and server connections. (The method might have been changed with *SSL\_CTX\_set\_ssl\_version*(3) or *SSL\_set\_ssl\_method()*.)

When beginning a new handshake, the SSL engine must know whether it must call the connect (client) or accept (server) routines. Even though it may be clear from the method chosen, whether client or server mode was requested, the handshake routines must be explicitly set.

When using the *SSL\_connect*(3) or *SSL\_accept*(3) routines, the correct handshake routines are automatically set. When performing a transparent negotiation using *SSL\_write*(3) or *SSL\_read*(3), the handshake routines must be explicitly set in advance using either *SSL\_set\_connect\_state()* or *SSL\_set\_accept\_state()*.

## RETURN VALUES

*SSL\_set\_connect\_state()* and *SSL\_set\_accept\_state()* do not return diagnostic information.

## SEE ALSO

[*ssl*(3)](/man/ssl/3.md), *SSL\_new*(3), *SSL\_CTX\_new*(3), *SSL\_connect*(3), *SSL\_accept*(3), *SSL\_write*(3), *SSL\_read*(3), *SSL\_do\_handshake*(3), *SSL\_CTX\_set\_ssl\_version*(3)
