Discussion:
Recursive curl download.
Arunkumar Manickam
2011-09-14 10:59:37 UTC
Permalink
Hi,

Here is a peculiar scenario...
We have an ongoing HTTPs session using libcurl compiled with openssl.
In the openssl verify call back, we need to download the CRL of the ssl
server certificate.
Can we initialise another curl easy handle and download CRL inside verify
call back function. We are already inside a call back function from a curl
download itself.

Is it advisable to do a new curl session from with in one of the callbacks
of another curl session.
If it is not, is there any call back we can register, to get notified once
the connection to a secure server is made, for further verifications.

Pls advice.

Thanks,
Arun
Daniel Stenberg
2011-09-14 18:32:54 UTC
Permalink
We have an ongoing HTTPs session using libcurl compiled with openssl. In the
openssl verify call back, we need to download the CRL of the ssl server
certificate. Can we initialise another curl easy handle and download CRL
inside verify call back function. We are already inside a call back function
from a curl download itself.
Is it advisable to do a new curl session from with in one of the callbacks
of another curl session.
I'm not sure it is advisable, but I can't see any reason why it wouldn't work.

Another option it to simply store the CRL and knowledge about it and abort the
transfer. Then fetch the CRL outside of the callback, and then re-do the first
request (which should be quick with connection re-use and SSL session id
re-use) and in the next invoke of the callback you'll have the CRL already
there...
is there any call back we can register, to get notified once the connection
to a secure server is made, for further verifications.
No, there's not. And I'll admit I don't quite see how that would save you from
this problem even if one such existed...
--
/ daniel.haxx.se
-------------------------------------------------------------------
List admin: http://cool.haxx.se/list/listinfo/curl-library
Etiquette: http://curl.haxx.se/mail/etiquette.html
Loading...