summaryrefslogtreecommitdiff
path: root/src/lib/libtls/man/tls_client.3
diff options
context:
space:
mode:
authorschwarze <>2017-01-25 23:53:18 +0000
committerschwarze <>2017-01-25 23:53:18 +0000
commit35fdef4d614c3469f40e63e53b292de178a9e20c (patch)
treefef38b6a567bfd2a81ea86890fca7a8ed7a42cff /src/lib/libtls/man/tls_client.3
parent276285ad64cc31b4a733563d702dd870939e4e53 (diff)
downloadopenbsd-35fdef4d614c3469f40e63e53b292de178a9e20c.tar.gz
openbsd-35fdef4d614c3469f40e63e53b292de178a9e20c.tar.bz2
openbsd-35fdef4d614c3469f40e63e53b292de178a9e20c.zip
split the tls_init(3) that had grown fat to allow healthy future growth;
suggested by jsing@; "i would just chuck it in" jmc@
Diffstat (limited to 'src/lib/libtls/man/tls_client.3')
-rw-r--r--src/lib/libtls/man/tls_client.387
1 files changed, 87 insertions, 0 deletions
diff --git a/src/lib/libtls/man/tls_client.3 b/src/lib/libtls/man/tls_client.3
new file mode 100644
index 0000000000..c8b2cb644e
--- /dev/null
+++ b/src/lib/libtls/man/tls_client.3
@@ -0,0 +1,87 @@
1.\" $OpenBSD: tls_client.3,v 1.1 2017/01/25 23:53:18 schwarze Exp $
2.\"
3.\" Copyright (c) 2014 Ted Unangst <tedu@openbsd.org>
4.\"
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.
8.\"
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.
16.\"
17.Dd $Mdocdate: January 25 2017 $
18.Dt TLS_CLIENT 3
19.Os
20.Sh NAME
21.Nm tls_client ,
22.Nm tls_server ,
23.Nm tls_configure ,
24.Nm tls_free
25.Nd configure a TLS connection
26.Sh SYNOPSIS
27.In tls.h
28.Ft struct tls *
29.Fn tls_client void
30.Ft struct tls *
31.Fn tls_server void
32.Ft int
33.Fo tls_configure
34.Fa "struct tls *ctx"
35.Fa "struct tls_config *config"
36.Fc
37.Ft void
38.Fn tls_free "struct tls *ctx"
39.Sh DESCRIPTION
40A TLS connection is represented as a
41.Vt struct tls
42object called a
43.Dq context .
44A new context is created by either the
45.Fn tls_client
46or
47.Fn tls_server
48functions.
49.Fn tls_client
50is used in TLS client programs,
51.Fn tls_server
52in TLS server programs.
53.Pp
54The context can then be configured with the function
55.Fn tls_configure .
56The same
57.Vt tls_config
58object can be used to configure multiple contexts.
59.Pp
60After configuration,
61.Xr tls_connect 3
62can be called on objects created with
63.Fn tls_client ,
64and
65.Xr tls_accept_socket 3
66on objects created with
67.Fn tls_server .
68.Pp
69After use, a TLS context should be closed with
70.Xr tls_close 3 ,
71and then freed by calling
72.Fn tls_free .
73.Sh RETURN VALUES
74.Fn tls_client
75and
76.Fn tls_server
77return
78.Dv NULL
79on error or an out of memory condition.
80.Pp
81.Fn tls_configure
82returns 0 on success or -1 on error.
83.Sh SEE ALSO
84.Xr tls_accept_socket 3 ,
85.Xr tls_config_new 3 ,
86.Xr tls_connect 3 ,
87.Xr tls_init 3