title: error using php curl with ssl certificate on Centos
body: <p>I am using php with curl to request some API the third-party supplies,as the API doc says,I should request the api with ssl certificate,I do.but the problem is when I run the script on my local environment(mac MAMP),the script works well,but when I deploy the script on my server(centos 6.5),the API can not response correctly,it says "error certificate",how this happen?<br />
  the code:</p>
  
  <pre><code>public function http_post_xml($data, $url){
          $sslcert_path = self::DATA_PATH.'cert/apiclient_cert.pem';
          $sslkey_path = self::DATA_PATH.'cert/apiclient_key.pem';
          $rootca_path = self::DATA_PATH.'cert/rootca.pem';
  
          $xml = '&lt;xml&gt;';
          foreach($data as $k=&gt;$v){
              $xml .= "&lt;{$k}&gt;$v&lt;/$k&gt;";
          }
          $xml .= '&lt;/xml&gt;';
  
          $curl = curl_init();
          curl_setopt($curl, CURLOPT_URL, $url);
          curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1 );
          curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, TRUE);
          curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
          curl_setopt($curl, CURLOPT_SSLCERTTYPE,'PEM');
          curl_setopt($curl, CURLOPT_SSLCERT, $sslcert_path);
          curl_setopt($curl, CURLOPT_SSLKEYTYPE, 'PEM');
          curl_setopt($curl, CURLOPT_SSLKEY, $sslkey_path);
          curl_setopt($curl, CURLOPT_CAINFO, $rootca_path);
          curl_setopt($curl, CURLOPT_POST, TRUE);
          curl_setopt($curl, CURLOPT_POSTFIELDS, $xml);
  
          $response = curl_exec($curl);
          $rep_xml = simplexml_load_string($response, null);
          $return_code = (String)$rep_xml-&gt;return_code;
  
          return array(
                  'code'=&gt;(String)$rep_xml-&gt;return_code,
                  'msg'=&gt;(String)$rep_xml-&gt;return_msg
              );
      }
  </code></pre>
  
  <p>I am sure the certificate path is correct.
  sorry for my bad enlish,but please help me....</p>