1 .\" $OpenBSD: tls_accept_socket.3,v 1.3 2017/01/28 00:59:36 schwarze Exp $
3 .\" Copyright (c) 2015 Ted Unangst <tedu@openbsd.org>
4 .\" Copyright (c) 2015 Joel Sing <jsing@openbsd.org>
5 .\" Copyright (c) 2016 Brent Cook <bcook@openbsd.org>
7 .\" Permission to use, copy, modify, and distribute this software for any
8 .\" purpose with or without fee is hereby granted, provided that the above
9 .\" copyright notice and this permission notice appear in all copies.
11 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
19 .Dd $Mdocdate: January 28 2017 $
20 .Dt TLS_ACCEPT_SOCKET 3
23 .Nm tls_accept_socket ,
26 .Nd accept an incoming client connection in a TLS server
32 .Fa "struct tls **cctx"
38 .Fa "struct tls **cctx"
45 .Fa "struct tls **cctx"
46 .Fa "ssize_t (*tls_read_cb)(struct tls *ctx,\
47 void *buf, size_t buflen, void *cb_arg)"
48 .Fa "ssize_t (*tls_write_cb)(struct tls *ctx,\
49 const void *buf, size_t buflen, void *cb_arg)"
53 After creating a TLS server context
57 and configuring it with
59 a server can accept a new client connection by calling
61 on an already established socket connection.
63 Alternatively, a new client connection can be accepted over a pair of existing
64 file descriptors by calling
69 allows read and write callback functions to handle data transfers.
72 parameter is passed back to the functions,
73 and can contain a pointer to any caller-specified data.
75 All these functions create a new context suitable for reading and writing
79 These functions return 0 on success or -1 on error.
82 .Xr tls_config_set_session_id 3 ,
91 and got its final name in
102 .An Joel Sing Aq Mt jsing@openbsd.org
107 .An Tobias Pape Aq Mt tobias@netshed.de .