I am consuming API in magento 2 using


Its working with http but not working with https so I am getting following error.

SSL certificate problem: self signed certificate

So how to disable SSL verification using Curl class.

1 Answer 1


After research I found the method name setOption in Class


And add following line in my code like this

$curl = new \Magento\Framework\HTTP\Client\Curl;


And it works :)

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.