Hands-on AWS knowledge base for developers Managed Ops
Talk to Us

.NET: The certificate chain was issued by an authority that is not trusted

Export PDF Print-friendly layout with a copyright watermark; choose Save as PDF in the print dialog
.NET: The certificate chain was issued by an authority that is not trusted — .NET: The certificate chain was issued by an authority that is not trusted

原因

.NET 校验时证书链链接不到「受信任的根证书颁发机构」:自签证书、私有 CA、或 Linux 上跑 .NET 缺 ca-certificates。

解决

  1. Windows:把根证书导入「受信任的根证书颁发机构」存储区(certmgr.msc);
  2. Linux 容器:apt install ca-certificates 后重跑;
  3. 私有 CA 可通过代码 X509ChainPolicy.ExtraStore 加自定义信任(不要直接 return true 跳过校验);
  4. 服务端问题同样先补全中间证书。