iOS で curl を使用して HTTPS サーバーへの安全な接続をセットアップしようとしています (アプリは C++ で記述されています)。
CURLOPT_CAPATH オプションのcacert.pam ( http://curl.haxx.se/ca/cacert.pem ) ファイル パスを設定する必要があることがわかりました。
curl_easy_setopt (curl, CURLOPT_CAPATH, "/var/mobile/Applications/811DEF2E-DE1D-4C86-A1FD-129478C8318D/MyApp.app/ca/cacert.pem");
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER, 1L);
curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST, 2L);
ただし、これは次の詳細ログを生成するだけです (ip と url が変更されました)。
libcurl/7.29.0 OpenSSL/1.0.1e zlib/1.2.5
* About to connect() to myserver.com port 443 (#0)
* Trying 128.128.128.128...
* Connected to myserver.com (128.128.128.128) port 443 (#0)
* successfully set certificate verify locations:
* CAfile: none
CApath: /var/mobile/Applications/171CA93F-15F2-42A1-938B-01812AF1E555/MyApp.app/ca/cacert.pem
* SSL certificate problem: unable to get local issuer certificate
* Closing connection 0
CURLOPT_CAPATH を "../MyApp.app/ca" フォルダーに設定すると、同じことが起こります。ファイルが存在し、読み取ることができます。
このエラーに関する情報が不足しているようです..何が間違っていますか?