hzt_asc 1.1.3 → 1.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/ask.cc +5 -0
  2. package/package.json +1 -1
package/ask.cc CHANGED
@@ -790,6 +790,7 @@ size_t write_data(char *ptr, size_t size, size_t nmemb, void *userdata)
790
790
  cv::Mat curlImg(const char *img_url, int timeout=100000)
791
791
  {
792
792
  //cout<<img_url<<endl;
793
+ char *pCaPath = "/opt/ssl_csr/*.haizitong.com.chained.crt";
793
794
  vector<uchar> stream;
794
795
  CURL *curl = curl_easy_init();
795
796
  curl_easy_setopt(curl, CURLOPT_URL, img_url); //the img url
@@ -797,6 +798,10 @@ cv::Mat curlImg(const char *img_url, int timeout=100000)
797
798
  curl_easy_setopt(curl, CURLOPT_WRITEDATA, &stream); // pass the stream ptr to the writefunction
798
799
  curl_easy_setopt(curl, CURLOPT_TIMEOUT, timeout); // timeout if curl_easy hangs,
799
800
  curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); //重定向一次
801
+
802
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 1L);
803
+ curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 2L);
804
+ curl_easy_setopt(curl, CURLOPT_CAINFO, pCaPath);
800
805
  CURLcode res = curl_easy_perform(curl); // start curl
801
806
 
802
807
  curl_easy_cleanup(curl); // cleanup
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hzt_asc",
3
- "version": "1.1.3",
3
+ "version": "1.1.4",
4
4
  "main": "index.js",
5
5
  "description": "hzt_asc_v3.",
6
6
  "author": {