How to get CA pem file content using PHP in server side

。_饼干妹妹 提交于 2020-03-28 06:40:22

问题


Anyone please tell me how we get the CA pem file content which send through PHP CURL CURLOPT_CAINFO or through postman, in server side using PHP

Please check below code

CURL *curl = curl_easy_init();
if(curl) {
  curl_easy_setopt(curl, CURLOPT_URL, "https://example.com/");
  curl_easy_setopt(curl, CURLOPT_CAINFO, "/etc/certs/cabundle.pem");
  ret = curl_easy_perform(curl);
  curl_easy_cleanup(curl);
}

In above code cabundle.pem contains certificate content. I need to fetch that content in end point ie.https://example.com/ server using PHP code.

Is that possible?

来源:https://stackoverflow.com/questions/60758515/how-to-get-ca-pem-file-content-using-php-in-server-side

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!