]> git.kaiwu.me - klib.git/commitdiff
default to following redirect & no SSL certificate
authorHeng Li <lh3@me.com>
Fri, 28 Nov 2014 16:49:11 +0000 (11:49 -0500)
committerHeng Li <lh3@me.com>
Fri, 28 Nov 2014 16:49:11 +0000 (11:49 -0500)
kurl.c

diff --git a/kurl.c b/kurl.c
index 4202d1013f69790b6dd08bedb5c15e45e60ec82b..3bf92901ca1f54adf22cccdce799eb58b207f512 100644 (file)
--- a/kurl.c
+++ b/kurl.c
@@ -175,6 +175,9 @@ kurl_t *kurl_open(const char *url, kurl_opt_t *opt)
                curl_easy_setopt(ku->curl, CURLOPT_VERBOSE, 0L);
                curl_easy_setopt(ku->curl, CURLOPT_NOSIGNAL, 1L);
                curl_easy_setopt(ku->curl, CURLOPT_WRITEFUNCTION, write_cb);
+               curl_easy_setopt(ku->curl, CURLOPT_SSL_VERIFYPEER, 0L);
+               curl_easy_setopt(ku->curl, CURLOPT_SSL_VERIFYHOST, 0L);
+               curl_easy_setopt(ku->curl, CURLOPT_FOLLOWLOCATION, 1L);
        }
        ku->m_buf = KU_DEF_BUFLEN;
        if (!kurl_isfile(ku) && ku->m_buf < CURL_MAX_WRITE_SIZE * 2)