'\" t .\" Title: upscli_init .\" Author: [FIXME: author] [see http://docbook.sf.net/el/author] .\" Generator: DocBook XSL Stylesheets v1.76.1 .\" Date: 09/13/2013 .\" Manual: NUT Manual .\" Source: Network UPS Tools 2.7.1-pre1 .\" Language: English .\" .TH "UPSCLI_INIT" "3" "09/13/2013" "Network UPS Tools 2\&.7\&.1\-p" "NUT Manual" .\" ----------------------------------------------------------------- .\" * 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 .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)