Images with https in mpdf

元气小坏坏 提交于 2019-12-06 05:10:16

For anyone coming here from Google - there is now a better solution. mPDF now supports setting curlAllowUnsafeSslRequests.

$mdf = new Mpdf(<your configuration>);
$mpdf->curlAllowUnsafeSslRequests = true;

This will set the CURL parameters properly for you without having to modify mPDF. Obviously, use only in appropriate situations, as this disables SSL all verification protections.

To resolve this issue you need to remove the protocol from URL for this I have created a plugin please install it and activate.

Here is the plugin link:- https://wordpress.org/plugins/vg-protocol-removed-not-secure-connection/

If you have a root cert, it's preferable to provide it using CURLOPT_CAINFO or CURLOPT_CAPATH than to bypass validation altogether.

It is a shame mPDF isn't designed better so you could avoid modifying the library code directly.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!