summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--libfetch/common.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/libfetch/common.c b/libfetch/common.c
index 1fbd0d4..3538cc4 100644
--- a/libfetch/common.c
+++ b/libfetch/common.c
@@ -735,6 +735,20 @@ fetch_close(conn_t *conn)
{
int ret;
+#ifdef WITH_SSL
+ if (conn->ssl) {
+ SSL_shutdown(conn->ssl);
+ SSL_set_connect_state(conn->ssl);
+ SSL_free(conn->ssl);
+ }
+ if (conn->ssl_ctx) {
+ SSL_CTX_free(conn->ssl_ctx);
+ }
+ if (conn->ssl_cert) {
+ X509_free(conn->ssl_cert);
+ }
+#endif
+
ret = close(conn->sd);
if (conn->cache_url)
fetchFreeURL(conn->cache_url);