1 .\" $OpenBSD: tls_client.3,v 1.4 2017/08/12 03:41:48 jsing Exp $
3 .\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
5 .\" Permission to use, copy, modify, and distribute this software for any
6 .\" purpose with or without fee is hereby granted, provided that the above
7 .\" copyright notice and this permission notice appear in all copies.
9 .\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 .\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 .\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 .\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 .\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 .\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 .\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 .Dd $Mdocdate: August 12 2017 $
26 .Nd configure a TLS connection
36 .Fa "struct tls_config *config"
39 .Fn tls_free "struct tls *ctx"
41 .Fn tls_reset "struct tls *ctx"
43 A TLS connection is represented as a
47 A new context is created by either the
53 is used in TLS client programs,
55 in TLS server programs.
57 The context can then be configured with the function
61 object can be used to configure multiple contexts.
65 can be called on objects created with
68 .Xr tls_accept_socket 3
69 on objects created with
72 After use, a TLS context should be closed with
74 and then freed by calling
78 is called with an argument of
82 A TLS context can be reset by calling
84 allowing for it to be reused.
85 This is essentially equivalent to calling
87 followed by a call to the same function that was used to originally allocate
95 on error or an out of memory condition.
98 returns 0 on success or -1 on error.
100 .Xr tls_accept_socket 3 ,
101 .Xr tls_config_new 3 ,
105 These functions appeared in
107 and got their final names in
110 .An Joel Sing Aq Mt jsing@openbsd.org