请帮助我。
我在localhost上尝试,这没问题。但是,当我尝试上传到服务器时,发现了问题。碰到此代码时,从cURL响应“无法与对等方安全通信:没有通用的加密算法。”
发生了什么事?任何人,请帮助我。
这是我的代码
$urlPush = "xxxxxx";
$header = array(
"Content-Type: application/x-www-form-urlencoded",
"APIKey: xxxxxx",
"credentials: xxxxx"
);
$dataPush = 'username=lineid007';
$ch = curl_init();
$username = 'xxx';
$password = 'xxx';
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $dataPush);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = json_decode(curl_exec($ch));
$err = curl_error($ch);
curl_close($ch);
echo json_encode($err); exit();