Skip to content

登录报 "The SSL connection could not be established" 的一个已定位根因:系统缺少 Spotify 自建 CA(Certainly)根证书 #689

Description

@lastwatch

之前 #206#213#247 都报过这个错误,不过跟我情况不完全一致。我最近在自己机器上完整排查了一次,找到了一个明确根因和解决办法,供参考。

现象

  • 登录 Spotify 时报 The SSL connection could not be established, see inner exception.
  • 手动粘贴回调链接时同样报错
  • 浏览器打开 Spotify 网页正常(因为 Chrome 用自己的根证书库)

本地情况:

  • 使用的是微软商店版本;
  • 本地为原生香港ip,未挂vpn,不存在无法ping通的问题,正常访问api.spotify.com和accounts.spotify.com。

根因

  • Lyricify(.NET)走 Windows 系统证书库;Spotify 登录服务器 accounts.spotify.com 的证书由 Spotify 自建 CA Certainly(CN=Certainly Root R1, O=Certainly, C=US)签发
  • 该根证书不在 Windows 内置根证书列表中(微软 authroot 列表里也没有),依赖“根证书自动更新”机制按需获取
  • 若系统禁用了根证书自动更新(常见于企业版/精简系统),或 CRL 缓存长期未刷新,就会一直验证失败,报 UntrustedRoot

排查方法(供对照)

curl.exe -sS -o NUL https://accounts.spotify.com
# 报 CRYPT_E_NO_REVOCATION_CHECK / 证书链错误即有问题
certutil -verify -urlfetch 保存的证书.cer   # 看 dwErrorStatus 是否含 CERT_TRUST_IS_UNTRUSTED_ROOT (0x20)

解决办法(管理员 PowerShell)

  1. 安装缺失的根(来源是证书链 AIA 字段里的官方地址 root-r1.certainly.com):
    certutil -addstore Root 某个包含Certainly根的cer文件
  2. 若仍失败,刷新吊销缓存/恢复根证书自动更新后重试
  3. 完全退出 Lyricify 后重新登录即可

给软件的建议

  • 报错时把 inner exception(如 AuthenticationException: The remote certificate is invalid ... UntrustedRoot)展示出来,用户就能自己搜索解决;现在只有最外层一句话"The SSL connection could not be established",无法定位
  • 可以在错误提示里加一条:怀疑证书问题时检查系统根证书更新是否被禁用

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions