curl-and-python
initialize CAINFO to lib default in pycurl
Date: Mon, 15 Aug 2011 10:33:12 -0500
Hello,
I am wondering if you know of a better way to initialize setup CAINFO to
something useful besides hardcoding the path in do_curl_new. Running
strings on libcurl reveals the path to CAINFO.
--- src/redhat/BUILD/pycurl-7.19.0/src/pycurl.c 2008-09-09
12:40:34.000000000 -0500
+++ src/pycurl.c 2011-08-12 11:43:46.250246671 -0500
@@ -806,6 +806,11 @@
}
self->options[ OPT_INDEX(CURLOPT_USERAGENT) ] = s; s = NULL;
+ /* Set CAINFO for some reason it's not already set */
+ res = curl_easy_setopt(self->handle, CURLOPT_CAINFO,
strdup("/etc/pki/tls/certs/ca-bundle.crt") );
+ if (res != CURLE_OK)
+ goto error;
+
/* Success - return new object */
return self;
Thanks,
John
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-python
Received on 2011-08-15