笔者之前写了个 python 脚本,负责用 imap 协议从网易邮箱中拉取邮件。2023-07-21 及以前能正常运行,之后这个脚本一执行就报错:
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)
本以为是 python 库版本/python 版本的问题,升级 python 后还是报这个错。用 openssl 验证后发现是服务器证书有问题:
$ openssl s_client -connect imap.163.com:993
...
Start Time: 1690210134
Timeout : 7200 (sec)
Verify return code: 21 (unable to verify the first certificate)
Extended master secret: no
---
* OK IMAP4 ready
昨天在网易邮箱的网页上提了反馈,不过目前还没有回应。
