You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用SendGrid Web API发送邮件时SSL证书验证失败问题求助

SendGrid Web API发送邮件时SSL证书验证失败问题求助

大家好,我在用SendGrid Web API发送邮件的时候碰到了SSL证书验证失败的错误,现在完全搞不清楚它到底在验证哪个证书。我已经完成了SendGrid账户里的用户验证和域名验证,而且发送流程写得非常简单,可还是出了问题。

下面是我遇到的错误:

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1000)>

我的代码如下:

mailClient = SendGridAPIClient(os.environ.get('sendGridKey'))
message = Mail(
            from_email=os.environ['sendGridEmail'],
            to_emails="dev@cribbi.co",
            subject="User Message for %s" %newMessage['chatId'],
            html_content = "<strong>" + newMessage['message']['text'] + "</strong>"
        )

mailRes = mailClient.send(message)

有没有大佬能帮我看看这是怎么回事呀?

备注:内容来源于stack exchange,提问作者Mitchell Leefers

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.14 14:03:07