1

I have a MAMP PRO set up with local SSL certificates for a url named qph-plugin.local which is running a wordpress site.

When I view the site in the browser on my machine it all works as expected. When I make a request to the url with postman it fails unless I turn off SSL verification, this is due to the fact my SSL certificates are just local for testing, but this atleast gets a 200 response for testing.

If a make a request from a framework (currently laravel) to the url using Guzzle or Curl I get the error:

Could not resolve host: qph-plugin.local Closing connection 0

Here is the current Guzzle request:

$client = new Client([
    'verify' => false, 'debug' => true
]);

$res = $client->get(
    'https://qph-plugin.local',[]
);

With the Guzzle request not working (this is what I intend to use) I tried a CURL request in the hope I could figure out whats wrong. Here is the current CURL request:

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://qph-plugin.local');
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_HTTPGET, 1);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_DNS_USE_GLOBAL_CACHE, false );
curl_setopt($ch, CURLOPT_DNS_CACHE_TIMEOUT, 2 );
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );

$res = curl_exec($ch);
curl_close($ch);

I have tried everything I can find online to resolve this but after hours of trial and error I do not seem to be any closer to the solution, hoping someone know whats wrong here?

Paul
  • 131
  • 1
  • 1
  • 3

0 Answers0