cURL fails when trying to connect to HTTPS on tvOS
SeanAsby opened this issue · 2 comments
SeanAsby commented
I built the libraries using build.sh
in the root folder. When trying to connect to an HTTPS endpoint I get the following error from cURL: SSL certificate problem: unable to get local issuer certificate
.
Is this a known issue? Do I need to enable some additional options when building?
I have also checked that the root certificate is preinstalled on tvOS.
https://support.apple.com/en-us/HT207232
jasonacox commented
It is looking for root certs and doesn't use the tvOS installed certs. You can add them to your project: https://curl.haxx.se/ca/cacert.pem
Then add them with something like this:
NSString *cacertPath = [[NSBundle mainBundle] pathForResource:@"cacert" ofType:@"pem"];
curl_easy_setopt(_curl, CURLOPT_CAINFO, [cacertPath UTF8String]); // set root CA certs
SeanAsby commented
That's what I ended up doing and it works. Thanks