When writing a client program using the libcurl library on a tailored Linux system, when executing an https request, since the Linux system does not have a root certificate file (libcurl tried to load the default certificate file /etc/ssl/certs/ca-certificates.crt, but This file does not exist at all, and this Linux file system is read-only), and eventually the https request fails. Is there a way to prevent libcurl from loading the default certificate file? The test program can then be completed by ignoring the CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options.
I tried setting the ignore CURLOPT_SSL_VERIFYPEER and CURLOPT_SSL_VERIFYHOST options, but libcurl still loads the /etc/ssl/certs/ca-certificates.crt certificate file by default. libcurl output error message:
* error setting certificate verify locations, continuing anyway:
* CAfile: /etc/ssl/certs/ca-certificates.crt
CApath: /etc/ssl/certs
* error:1416D108:SSL routines:tls_process_key_exchange:wrong signature length
I've also tried setting CURLOPT_CAINFO to a file that doesn't exist, and that doesn't stop libcurl from loading the default certificate (the certificate doesn't exist and the load eventually fails)
What should I do to cancel libcurl's default behavior of loading system certificates, thanks!