如何通过libcurl通过https下载数据?

时间:2018-06-16 18:27:46

标签: c++ libcurl

构建libcurl + openssl。我不能使用https。我收到一个错误:SSL证书问题:无法获得本地颁发者证书。我可以不用

curl_easy_setopt( curl, CURLOPT_SSL_VERIFYHOST, 0 );
curl_easy_setopt( curl, CURLOPT_SSL_VERIFYPEER, 0 );

并加载https数据?

1 个答案:

答案 0 :(得分:0)

我下载了cacert.pem(https://curl.haxx.se/docs/caextract.html),并粘贴了此选项。

let gradientFrame = CGRect(x: 0, y: 0, width: 1000, height: 150)
_progressGradientLayer.frame = gradientFrame
_progressGradientLayer.colors = [UIColor.red, UIColor.green, UIColor.red, UIColor.green, UIColor.red].map { $0.cgColor }
_progressGradientLayer.startPoint = CGPoint(x: 0, y: 0)
_progressGradientLayer.endPoint = CGPoint(x: 1, y: 0)
_progressGradientLayer.locations = [0, 0.25, 0.5, 0.75, 1]

_progressGradientLayer.mask = _progressLayer
self.layer.addSublayer(self._progressGradientLayer)

let progressPath = //some path
self._progressLayer.path = progressPath.cgPath
self._progressLayer.fillColor = self.selectedBackgoundColor.cgColor
self._progressLayer.frame = shapeFrame

//TODO: Apply the _blackLayer mask to the gradient