0

I read some SO questions and answers but I can't solve my problem.

I've a cURL request:

function dmd_check_key($arg){
    $curl = curl_init();
    curl_setopt_array($curl, array(
        CURLOPT_RETURNTRANSFER => 1,
        CURLOPT_URL => 'https://***.de/dmd-pages-pro/dmd_key_generator.php?key='.$arg.'&website='.$_SERVER['HTTP_HOST'],
        CURLOPT_USERAGENT => 'Codular Sample cURL Request',
        CURLOPT_VERBOSE => 1
    ));
    curl_setopt($curl, CURLOPT_STDERR, fopen("curl_debug.txt", "w+"));
    $resp = curl_exec($curl);
    curl_close($curl);

    if(!get_option('dmd-pages-key-status')){add_option('dmd-pages-key-status', $resp);}else{update_option('dmd-pages-key-status', $resp);}    
    if(!get_option('dmd-pages-key')){add_option('dmd-pages-key', $arg);}else{update_option('dmd-pages-key', $arg);}    

    return $resp;
}

I got this errormessage:

  • Hostname was NOT found in DNS cache
  • Trying 00.13.133.000...
  • Connected to dimadirekt.de (00.13.133.000) port 443 (#0)
  • successfully set certificate verify locations:
  • CAfile: none CApath: /etc/ssl/certs
  • SSL certificate problem: unable to get local issuer certificate
  • Closing connection 0

Can someone explain me the errormessage and how I can resolve it?

I think the problem is the certificate. But on which server? I have two.

One server with the cURL file (nonssl) and one server which handles the data (ssl).

I try this settings:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

But it is still not working.

EDIT:

With the settings line above:

curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

The errormessage is gone.

Now the problem is that I don't get any response.

Now I get this response:

  • Hostname was NOT found in DNS cache
  • Trying 00.13.133.212...
  • Connected to ***.de (00.13.000.212) port 443 (#0)
  • successfully set certificate verify locations:
  • CAfile: none CApath: /etc/ssl/certs
  • SSL connection using ECDHE-RSA-AES128-GCM-SHA256
  • Server certificate:
  • subject: OU=Domain Control Validated; CN=www.***.de
  • start date: 2016-03-03 00:00:00 GMT
  • expire date: 2019-06-01 23:59:59 GMT
  • subjectAltName: ***.de matched
  • issuer: C=GB; ST=Greater Manchester; L=Salford; O=COMODO CA Limited; CN=COMODO RSA Domain Validation Secure Server CA
  • SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.

    GET /dmd-pages-pro/dmd_key_generator.php?key=27dda19e85378bb8df73fa3f2806a30c&website=ak.dimadirekt.com HTTP/1.1 User-Agent: Codular Sample cURL Request Host: ***.de Accept: /

< HTTP/1.1 200 OK < Date: Tue, 31 May 2016 11:07:49 GMT * Server Apache is not blacklisted < Server: Apache < Vary: Accept-Encoding < Transfer-Encoding: chunked < Content-Type: text/html < * Connection #0 to host dimadirekt.de left intact

cgee
  • 1,910
  • 2
  • 22
  • 38
  • For security Reasons, you should do what [this post](http://stackoverflow.com/a/24618403/1154316) suggests (2.)! Maybe that also fixes your 'no response' problem, but I think that's an Problem on the remote server/application – tillz May 31 '16 at 11:13
  • The 'no response' Problem may also be a problem that the remote server tries to redirect your request, in which case you'd need to set `CURLOPT_FOLLOWLOCATION` true to make CURL follow these redirects – tillz May 31 '16 at 11:16
  • You see my code? $resp.. In this var there is a true!!! o.O But if I want to use it (add_option('dmd-pages-key-status', $resp)) the $resp is empty... I solved my problem in another way. But thanks for your answers. – cgee May 31 '16 at 11:23

0 Answers0