7

In PHP curl there are two functions used to ignore all SSL errors (invalid cert, self signed, expired, so on):

curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

I am switching over to use Zend_Http_Client, but I can't seem to find a way to force it to ignore errors. (I don't have a way to test it just yet, I wanted to see if anybody has done this before)

So, does anybody know the equivalent function/functions to do this in Zend_Http_Client?

1 Answer 1

8

You can do something like this,

   $connection = new Zend_Http_Client();
   $streamOpts = array(
            'ssl' => array(
                'verify_peer' => false,
                'allow_self_signed' => true
             )
   );

   $adapter = new Zend_Http_Client_Adapter_Socket();
   $connection->setAdapter($adapter);
   $adapter->setStreamContext($streamOpts);
Sign up to request clarification or add additional context in comments.

1 Comment

Ah, and is that only specific to the Socket adapter? I was hoping for something that would apply it to any adapter I used in Zend

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.