1

I prepared a url with user credentials to validate client and return the file I post it with curl in php 5.6.13 within this code piece:

$url ="https://192.168.0.15:10445/wfmi/Infrastructure/getFile.php?filenamecentraldb=".$_GET["filename"]."&username=administrator&password=passwordofadmin";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);

But response is always false..

I run ch_error($ch) and it returns

"Peer certificate cannot be authenticated with known CA certificates" what does this mean ?

Here is the target page:

if(isset($_GET["filenamecentraldb"]))
{
    error_log("Check1");//never reach there...
    try
    {
        $username = $_GET["username"];
        $password = $_GET["password"];
        ...
        exit(0);
    }
    catch (PDOException $e)
    {
        echo "Error ocurred:".$e->getMessage();
        exit(0);
    }
    catch (Exception $e)
    {
        echo "Error ocurred:".$e->getMessage();
        exit(0);
    }
}
2
  • check last error by function curl_error() and check your resource $ch Commented Feb 25, 2016 at 16:28
  • Hello, it almost answer.. I edited question thank you for response Commented Feb 25, 2016 at 16:32

1 Answer 1

3

Since you're using private IPs and (most likely a dummy ssl certificate), you need to disable ssl verification for your requests.

 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

But be aware that this is a security risk. So avoid this in a production environment

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.