• CA 证书


    1.ubuntu curl 命令报错(CA)

    kamil@vm-ubuntu:~$ curl https://szxyzs.vanke.com/DataCenter/datacenter/api
    curl: (60) SSL certificate problem: unable to get local issuer certificate
    More details here: http://curl.haxx.se/docs/sslcerts.html
    
    curl performs SSL certificate verification by default, using a "bundle"
     of Certificate Authority (CA) public keys (CA certs). If the default
     bundle file isn't adequate, you can specify an alternate file
     using the --cacert option.
    If this HTTPS server uses a certificate signed by a CA represented in
     the bundle, the certificate verification probably failed due to a
     problem with the certificate (it might be expired, or the name might
     not match the domain name in the URL).
    If you'd like to turn off curl's verification of the certificate, use
     the -k (or --insecure) option.
    kamil@vm-ubuntu:~$ 

    原因:

    此问题的出现是由于没有配置信任的服务器HTTPS验证。默认,cURL被设为不信任任何CAs,就是说,它不信任任何服务器验证。因此,这就是浏览器无法通过HTTPs访问你服务器的原因。当此问题出现时,网络程序员最好的办法是充分指定一组默认的受信任CAs,前提是你已经从这些CAs中购买过证书。
    如果你的内容不敏感,一个快捷的方法是使用curl_exec()之前跳过ssl检查项:
    
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    
    公众号请关注:侠之大者
  • 相关阅读:
    vue axios前端跨域问题
    DDD的神奇
    开源电子书《WoW C#》
    15项架构原则
    龙芯发布.NET 6.0.100开发者测试版
    国内 Mono 相关文章汇总
    Kubernetes应用程序开发认证(CKAD) 经验分享
    [LeetCode] 1281. Subtract the Product and Sum of Digits of an Integer 整数的各位积和之差
    我(webabcd)的文章索引
    上周热点回顾(1.31.9)
  • 原文地址:https://www.cnblogs.com/kamil/p/5466181.html
Copyright © 2020-2023  润新知