Visualizzazione risultati 1 fino 2 di 2

Discussione: Problems using callback function

  1. #1
    Guest

    Predefinito Problems using callback function

    Hi there,

    I've been using your hosting service for almost a year now and so far have had no problems with it.
    About an hour ago, a site that I was running started experiencing problems. Specifically - I am getting this error when trying to call a callback function:
    "SSL certificate problem: unable to get local issuer certificate"

    This is the code I'm using that produces this error:
    Codice:
        $code=$_GET['code'];
        $state=$_GET['state'];
    
    
        //Do the initial check.
        $header='Authorization: Basic '.base64_encode($client_id.':'.$secret);
        $fields_string='';
        $fields=array(
                    'grant_type' => 'authorization_code',
                    'code' => $code
                );
        foreach ($fields as $key => $value) {
            $fields_string .= $key.'='.$value.'&';
        }
        $fields_string = rtrim($fields_string, '&');
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $token_url);
        curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array($header));
        curl_setopt($ch, CURLOPT_POST, count($fields));
        curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        //curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
        //curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
        // While using this is optional, it may be required if you encounter
        // the "SSL certificate problem: unable to get local issuer certificate"
        // error when calling the API using curl.
        curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
    
        $result = curl_exec($ch);
    
        if ($result===false) {
            auth_error(curl_error($ch));
        }
    It had no problems up to an hour ago. Was there any change introduced in your hosting service?

  2. #2
    karl94 non è connesso Staff AV
    Data registrazione
    03-10-2005
    Messaggi
    17,744

    Predefinito

    Hi, this is the Italian support forum, please post on the one in English: http://forum.en.altervista.org/
    You'll also need to provide the URL of the resource that your script is trying to retrieve.
    Ultima modifica di karl94 : 11-03-2015 alle ore 20.08.11

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •