int openconnect_set_cafile(struct openconnect_info *vpninfo, const char *cafile) { UTF8CHECK(cafile); STRDUP(vpninfo->cafile, cafile); return 0; }
int openconnect_set_localname(struct openconnect_info *vpninfo, const char *localname) { UTF8CHECK(localname); STRDUP(vpninfo->localname, localname); return 0; }
int openconnect_set_urlpath(struct openconnect_info *vpninfo, const char *urlpath) { UTF8CHECK(urlpath); STRDUP(vpninfo->urlpath, urlpath); return 0; }
int openconnect_set_client_cert(struct openconnect_info *vpninfo, const char *cert, const char *sslkey) { UTF8CHECK(cert); UTF8CHECK(sslkey); /* Avoid freeing it twice if it's the same */ if (vpninfo->sslkey == vpninfo->cert) vpninfo->sslkey = NULL; STRDUP(vpninfo->cert, cert); if (sslkey) { STRDUP(vpninfo->sslkey, sslkey); } else { vpninfo->sslkey = vpninfo->cert; } return 0; }
int openconnect_set_hostname(struct openconnect_info *vpninfo, const char *hostname) { UTF8CHECK(hostname); STRDUP(vpninfo->hostname, hostname); free(vpninfo->unique_hostname); vpninfo->unique_hostname = NULL; free(vpninfo->peer_addr); vpninfo->peer_addr = NULL; return 0; }