else if (err == SSL_ERROR_WANT_WRITE)
FD_SET(vpninfo->ssl_fd, &wr_set);
else {
- vpn_progress(vpninfo, PRG_ERR, _("Failed to write to SSL socket"));
+ vpn_progress(vpninfo, PRG_ERR, _("Failed to write to SSL socket\n"));
openconnect_report_ssl_errors(vpninfo);
return -EIO;
}
if (err) {
vpn_progress(vpninfo, PRG_ERR,
_("Loading certificate failed. Aborting.\n"));
+ SSL_CTX_free(vpninfo->https_ctx);
+ vpninfo->https_ctx = NULL;
+ close(ssl_sock);
return err;
}
check_certificate_expiry(vpninfo);
BIO *b = BIO_from_keystore(vpninfo, vpninfo->cafile);
if (!b) {
+ SSL_CTX_free(vpninfo->https_ctx);
+ vpninfo->https_ctx = NULL;
close(ssl_sock);
return -EINVAL;
}
_("Failed to read certs from CA file '%s'\n"),
vpninfo->cafile);
openconnect_report_ssl_errors(vpninfo);
+ SSL_CTX_free(vpninfo->https_ctx);
+ vpninfo->https_ctx = NULL;
close(ssl_sock);
return -ENOENT;
}
_("Failed to open CA file '%s'\n"),
vpninfo->cafile);
openconnect_report_ssl_errors(vpninfo);
+ SSL_CTX_free(vpninfo->https_ctx);
+ vpninfo->https_ctx = NULL;
close(ssl_sock);
return -EINVAL;
}
while ((err = SSL_connect(https_ssl)) <= 0) {
fd_set wr_set, rd_set;
int maxfd = ssl_sock;
-
+
FD_ZERO(&wr_set);
FD_ZERO(&rd_set);