Example #1
0
 /**
  * 传递 clientAuth 证书,并要求检验 API 服务器证书
  *
  * @param Request $request
  * @return Request
  */
 private static function authenticate(Request $request)
 {
     $request->additional_curl_opts[CURLOPT_SSL_VERIFYPEER] = true;
     $request->additional_curl_opts[CURLOPT_SSL_VERIFYHOST] = 0;
     $request->additional_curl_opts[CURLOPT_CAINFO] = Application::$CONFIG_DIRECTORY . '/cert-ca.crt';
     return $request->authenticateWithCert(Application::$CONFIG_DIRECTORY . '/cert-bg-client.crt', Application::$CONFIG_DIRECTORY . '/cert-bg-client.key');
 }