nut/docs/man/upscli_init.3

59 lines
2.7 KiB
Groff
Raw Normal View History

2013-11-24 15:00:12 +00:00
'\" t
.\" Title: upscli_init
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
2015-04-30 13:53:36 +00:00
.\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
2016-07-18 00:11:41 +00:00
.\" Date: 03/02/2016
2013-11-24 15:00:12 +00:00
.\" Manual: NUT Manual
2016-07-18 00:11:41 +00:00
.\" Source: Network UPS Tools 2.7.3.1
2013-11-24 15:00:12 +00:00
.\" Language: English
.\"
2016-07-18 00:11:41 +00:00
.TH "UPSCLI_INIT" "3" "03/02/2016" "Network UPS Tools 2\&.7\&.3\&." "NUT Manual"
2013-11-24 15:00:12 +00:00
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
upscli_init \- Initialize upsclient module specifying security properties\&.
.SH "SYNOPSIS"
.sp
.nf
#include <upsclient\&.h>
.fi
.sp
.nf
int upscli_init(int certverify, const char *certpath,
const char *certname, const char *certpasswd);
.fi
.SH "DESCRIPTION"
.sp
The \fBupscli_init()\fR function initialize upsclient module and set many SSL\-related properties: \fIcertverify\fR to 1 makes certificate verification required for all SSL connections and \fIcertpath\fR is the location of certificate database\&.
.sp
If compiled with OpenSSL, certpath refers to a \&.pem file containing certificates and if compiled with NSS, certpath refers to a directory containing database files\&.
.sp
If compiled with NSS and using SSL, you can specify \fIcertname\fR the name of the certificate to send to upsd and \fIcertpasswd\fR the password used to decrypt certificate private key\&.
.sp
You can call \fBupscli_add_host_cert\fR(3) to register specific host security policy before initialize connections to them\&.
.sp
You must call \fBupscli_cleanup\fR(3) when exiting application\&.
.SH "RETURN VALUE"
.sp
The \fBupscli_init()\fR function returns 1 on success, or \-1 if an error occurs\&.
.SH "SEE ALSO"
.sp
\fBupscli_add_host_cert\fR(3), \fBupscli_cleanup\fR(3), \fBupscli_disconnect\fR(3), \fBupscli_fd\fR(3), \fBupscli_splitaddr\fR(3), \fBupscli_splitname\fR(3), \fBupscli_ssl\fR(3), \fBupscli_strerror\fR(3), \fBupscli_upserror\fR(3)