我正在开发一个带有身份验证的简单 API,在 .NET 上制作,并且想使用 Insomnia 对其进行一些测试。API 使用 OAuth 2 客户端凭据,这就是我遇到麻烦的地方。
无法获取令牌 url=https://localhost:5001/connect/token status=0
未提供说明
所以我无法获得令牌,因此我无法向我的 API 发出任何请求。这很奇怪,因为我的简单客户端控制台应用程序可以获取令牌,这让我认为问题不在身份服务器或API的代码中,但 Insomnia 无法获取本地颁发者证书。
以下是响应时间表:
Preparing request to https://localhost:5001/connect/token
Current time is 2022-02-21T03:55:30.752Z
Using libcurl/7.73.0-DEV OpenSSL/1.1.1g zlib/1.2.11 brotli/1.0.9 WinIDN libssh2/1.9.0_DEV nghttp2/1.41.0
Using default HTTP version
Disable timeout
Enable automatic URL encoding
Enable SSL validation
Enable cookie sending with jar of 0 cookies
Trying ::1:5001...
Connected to localhost (::1) port 5001 (#0)
ALPN, offering h2
ALPN, offering http/1.1
successfully set certificate verify locations:
CAfile: C:\Users\********\AppData\Local\Temp\insomnia_2021.7.2\ca-certs.pem
CApath: none
TLSv1.3 (OUT), TLS handshake, Client hello (1):
TLSv1.3 (IN), TLS handshake, Server hello (2):
TLSv1.2 (IN), TLS handshake, Certificate (11):
TLSv1.2 (OUT), TLS alert, unknown CA (560):
SSL certificate problem: unable to get local issuer certificate
Closing connection 0
Run Code Online (Sandbox Code Playgroud)
我已经到处寻找解决方案,但一无所获,所以如果有人能为我阐明这个问题,我会非常高兴。