LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Curl CURLOPT_SSL_CTX_FUNCTION issue (https://www.linuxquestions.org/questions/linux-general-1/curl-curlopt_ssl_ctx_function-issue-819907/)

Manjunath1847 07-15-2010 01:36 AM

Curl CURLOPT_SSL_CTX_FUNCTION issue
 
I have an issue with using root certificate, with curl CURLOPT_SSL_CTX_FUNCTION option. I tried one of the example program docs/examples/cacertinmem.c which is avilable along with the curl source download. This program is using CURLOPT_SSL_CTX_FUNCTION to set the hardcoded certificate before doing https transaction. But this program works only if I put the certificate bundle in the proper path. That means https transaction is happening beacuse of the certficate bundle and not from the root certificate which is provided in the program. This is also clear from the verbose output. As per curl documents CURLOPT_SSL_CTX_FUNCTION option actually takes the function pointer as an argument, which is called before SSL transaction so that it allows to change SSL settings. But when I run this program to get the https page, looks like the CURLOPT_SSL_CTX_FUNCTION is not calling the specfied callback funtion.

Please can anyone help me on this.

Thanks in advance.

Manjunath1847 07-16-2010 05:01 AM

I am not sure but it Looks like curl handles are caching the options that are set. In the curl source downloaded example program docs/examples/cacertinmem.c, it is first trying to do the https transction without setting the callback certificate set function, after it fails it is retrying by setting the callback certificate set function. When I set the callback certificate set function directly things are working. But retying without and with setting is not working in that example


All times are GMT -5. The time now is 04:08 PM.