I need to do a simple GET request to EC2 Query API with regular URL encoded query string. The protocol is HTTPS. How would I send the request with the help of PHP\'s cURL.
Example:
$url = "https://example.com";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
$result = curl_exec($ch);
curl_close($ch);
print_r($result);
CURLOPT_SSL_VERIFYPEER
Check if peer certificate is valid or invalid/expired.
CURLOPT_SSL_VERIFYHOST quoting from php manual:
1 to check the existence of a common name in the SSL peer certificate. 2 to check the existence of a common name and also verify that it matches the hostname provided.