当我在浏览器中输入:' https://myemail:mypassword@api.hellosign.com/v3/account '
我明白了
{"account":{"account_id":"**************","email_address":"myemail","callback_url":null,"role_code":null}}
这似乎是一个有效的回应。
我正在尝试使用 libcurl php 库在 php 中实现这一点。我有以下内容,但是当我在 $response 变量上运行 var_dump 时得到 FALSE。关于 libcurl 设置的任何想法?我已经尝试对整个字符串进行 urlencoding 和不使用身份验证子字符串“myemail:mypassword”的 base_64 编码。提前致谢:
$final_string= 'https://myemail:mypassword@api.hellosign.com/v3/account';
$curl = curl_init();
curl_setopt($curl, CURLOPT_USERAGENT, 'HelloSign-PHP');
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, 1);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 1);
curl_setopt($curl, CURLOPT_URL, $final_string);
curl_setopt($curl, CURLOPT_HEADER, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, self::$time_out);
$response = curl_exec($curl);
// Get the status code
$http_status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
if(curl_exec($curl) === false)
{
echo 'Curl error: ' . curl_error($curl);
}
else
{
echo 'Operation completed without any errors';
}
curl_close($curl);
output is :
Curl error: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failedProblem connecting to HelloSign.