php + cURL + TLS 1.2

时间:2019-10-13 06:42:22

标签: php ssl curl tls1.2

我正在使用maxmind GEOIP精密在线服务来获取有关访客区域/城市的信息。 他们正在将其协议升级到TLS 1.2。我试图更改代码,但他们告诉我日志显示我仍在使用TLS 1.0发送请求

$ch = curl_init();  
curl_setopt($ch, CURLOPT_URL, "https://geoip.maxmind.com/geoip/v2.1/insights/178.166.46.246"); 
curl_setopt($ch, CURLOPT_USERPWD, $username . ":" . $password);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 


curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); 
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);


$result = curl_exec($ch);  
curl_close($ch);  
return $result;

添加“ CURL_SSLVERSION_TLSv1_2”似乎没有帮助。 我在这里可能会想念什么?

1 个答案:

答案 0 :(得分:0)

添加

tableView.beginUpdates()
tableView.deleteRows(at: [indexPath], with: .top) // Check (.)after for available animation example comment   out below -
//tableView.deleteRowsAtIndexPaths([YourIndexPathYouWantToDeleteFrom], with: .left)
//tableView.deleteRowsAtIndexPaths([YourIndexPathYouWantToDeleteFrom], with: .right)
//tableView.deleteRowsAtIndexPaths([YourIndexPathYouWantToDeleteFrom], with: .up)
//tableView.deleteRowsAtIndexPaths([YourIndexPathYouWantToDeleteFrom], with: .down)
//tableView.deleteRowsAtIndexPaths([YourIndexPathYouWantToDeleteFrom], with: .fade)
//tableView.deleteRowsAtIndexPaths([YourIndexPathYouWantToDeleteFrom], with: .middle)
//tableView.deleteRowsAtIndexPaths([YourIndexPathYouWantToDeleteFrom], with: .bottom)
tableView.endUpdates()

这将强制执行使用TLS 1.2的请求。