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\&.
If compiled with OpenSSL, certpath refers to directory containing certificates where the certificates must be named according to their hash values ending in a "\&.0" extension\&. If two certificates result in the same hash value (thus file name), the "\&.0" can be incremented to "\&.1" and so on, as needed\&. The bash command for creating links in this manner would be:
Alternatively, the c_rehash utility (provided by openssl\-perl) can take a directory and iterate it to link all certificates found in that directory, in the manner described above\&.
.sp
If compiled with NSS, certpath refers to a directory containing database files\&.
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\&.