gpt4 book ai didi

azure - 在 Azure APIM 以及 postman 中获取 "403 Invalid client certificate"

转载 作者:行者123 更新时间:2023-12-04 22:41:16 25 4
gpt4 key购买 nike

所以我正在关注此链接:https://learn.microsoft.com/en-gb/azure/api-management/api-management-howto-mutual-certificates-for-clients 。我添加了两项政策 -

1)检查指纹(对于包含证书的传入请求)

<choose>
<when condition="@(context.Request.Certificate == null || !context.Request.Certificate.Verify() || context.Request.Certificate.Thumbprint != "DESIRED-THUMBPRINT-IN-UPPER-CASE")" >
<return-response>
<set-status code="403" reason="Invalid client certificate" />
</return-response>
</when>
</choose>

2)根据上传到 API 管理的证书检查指纹(我在 APIM 的“证书”部分上传了自签名证书)

<choose>
<when condition="@(context.Request.Certificate == null || !context.Request.Certificate.Verify() || !context.Deployment.Certificates.Any(c => c.Value.Thumbprint == context.Request.Certificate.Thumbprint))" >
<return-response>
<set-status code="403" reason="Invalid client certificate" />
</return-response>
</when>

现在,当我尝试在 azure 中从 APIM 发送 get 请求时,我遇到一个错误,提示“403 无效的客户端证书”。在 postman 中,我也添加了证书,但在发送 get 时遇到相同的错误请求。

enter image description here

我使用 openssl 制作了自签名证书并将其转换为 .key 、 .crt 和 .pfx。我也阅读了其他相关线程,但我没有找到此问题的任何解决方案。我不知道我是否做错了或者我我错过了一些东西。请帮我解决这个问题。谢谢。

最佳答案

从您发布的文档链接:

Note

您的证书是自签名的,因此不可信。也尝试将其添加到 APIM 中的 CA 证书部分。

关于azure - 在 Azure APIM 以及 postman 中获取 "403 Invalid client certificate",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62059889/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com