微信网页版开发报错:curl_setopt(): CURLOPT_SSL_VERIFYHOST no longer accepts the value 1, value 2 will be used instead in ......
这个报错需要把curl设置里的
curl_setopt ( $curl_handle, CURLOPT_SSL_VERIFYHOST, true );
改成
curl_setopt ( $curl_handle, CURLOPT_SSL_VERIFYHOST, 2 );
说明:
CURLOPT_SSL_VERIFYHOST的值
设为0表示不检查证书
设为1表示检查证书中是否有CN(common name)字段
设为2表示在1的基础上校验当前的域名是否与CN匹配
而libcurl早期版本中这个变量是boolean值,为true时作用同目前设置为2,后来出于调试需求,增加了仅校验是否有CN字段的选项,因此两个值true/false就不够用了,升级为0/1/2三个值。
再后来(libcurl_7.28.1之后的版本),这个调试选项由于经常被开发者用错,被去掉了,因此目前也不支持1了,只有0/2两种取值。
引自 libcurl API
When the verify value is 1, curl_easy_setopt will return an error and
the option value will not be changed. It was previously (in 7.28.0 and
earlier) a debug option of some sorts, but it is no longer supported
due to frequently leading to programmer mistakes. Future versions will
stop returning an error for 1 and just treat 1 and 2 the same.
最新版本,它的默认值就是2,因此,这行代码,可以省略不写。
参考链接:https://segmentfault.com/q/1010000002396283
vue2 Implicit conversion from float int loses precision php8Implicit Mysql8新增用户,mysql8配置权限,mysql8配置,mysql8配置文件 Linux命令,scp,scp命令,Linux复制 git commit git add centos git 搭建FTP,Linux FTP,禁止FTP登录ssh 上传文件,阿里云OSS上传,文件上传到OSS,OSS文件上传,OSS上传 微信支付,微信支付V3,PHP微信支付,微信nativePay支付,微信jsapi支付 微信支付,微信支付V3,PHP微信支付 bootstrap4 modal, lavarel The subversion command line tools are no longer provided by Xcode. 银联支付,tp5.1银联支付 支付宝即时到账,PHP支付宝 system libzip must be upgraded to version >= 0.11 CMake 3.0.2 or higher is required