apereo / phpCAS

Apereo PHP CAS Client
https://apereo.github.io/phpCAS/
Apache License 2.0
796 stars 397 forks source link

setNoCasServerValidation not working if cURL > 7.10 php 5.4 #122

Closed johanneshahn closed 9 years ago

johanneshahn commented 10 years ago

phpCAS::setNoCasServerValidation(); does not work if cUrl Version is greater 7.10 -> CURLOPT_SSL_VERIFYPEER is set to true as new default see: http://de3.php.net/manual/en/function.curl-setopt.php

Changed Code CurlRequest.php near line: 134 from:

...

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
        curl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath);
        phpCAS::trace('CURL: Set CURLOPT_CAINFO ' . $this->caCertPath);
    } else {
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
    }

...

to:

...

    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 1);
        curl_setopt($ch, CURLOPT_CAINFO, $this->caCertPath);
        phpCAS::trace('CURL: Set CURLOPT_CAINFO ' . $this->caCertPath);
    } else {
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
    }

...

jfritschi commented 10 years ago

I cannot find the code you reference in the master branch. Please check whether master works for you.

misilot commented 10 years ago

I believe this is what @johanneshahn is talking about here.

https://github.com/Jasig/phpCAS/blob/1.3.3/source/CAS/Request/CurlRequest.php#L121-L132