GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
TLS_CLIENT(3) FreeBSD Library Functions Manual TLS_CLIENT(3)

tls_client, tls_server, tls_configure, tls_reset, tls_free
configure a TLS connection

#include <tls.h>

struct tls *
tls_client(void);

struct tls *
tls_server(void);

int
tls_configure(struct tls *ctx, struct tls_config *config);

void
tls_free(struct tls *ctx);

void
tls_reset(struct tls *ctx);

A TLS connection is represented as a struct tls object called a “context”. A new context is created by either the tls_client() or tls_server() functions. tls_client() is used in TLS client programs, tls_server() in TLS server programs.

The context can then be configured with the function tls_configure(). The same tls_config object can be used to configure multiple contexts.

After configuration, tls_connect(3) can be called on objects created with tls_client(), and tls_accept_socket(3) on objects created with tls_server().

After use, a TLS context should be closed with tls_close(3), and then freed by calling tls_free(). If tls_free() is called with an argument of NULL, no action occurs.

A TLS context can be reset by calling tls_reset(), allowing for it to be reused. This is essentially equivalent to calling tls_free(), followed by a call to the same function that was used to originally allocate the TLS context.

tls_client() and tls_server() return NULL on error or an out of memory condition.

tls_configure() returns 0 on success or -1 on error.

tls_accept_socket(3), tls_config_new(3), tls_connect(3), tls_init(3)

These functions appeared in OpenBSD 5.6 and got their final names in OpenBSD 5.7.

Joel Sing <jsing@openbsd.org>
August 12, 2017 FreeBSD 13.1-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.