目前我正在使用 HTTP 1.1 和 HTTP/2 在 IIS 10 上测试 Web 应用程序。我的测试应用程序有一个端点 (/api/test),它只返回“true”。我有3个证书:
根 CA 和服务器证书安装在 Windows Server 2016 上,IIS 网站配置为使用服务器证书侦听https://example.net:8081/。此外,我将网站配置为需要客户端证书(这对我的测试很重要,我需要服务器/客户端证书验证)。
我通过 curl 测试我的应用程序,对于 http1.1 一切正常。
命令:
curl.exe --http1.1 --get --url https://example.net:8081/api/test --cacert E:\ca.pem --cert E:\client.pem --key E:\client.key --cert-type PEM --verbose
Run Code Online (Sandbox Code Playgroud)
输出:
* TCP_NODELAY set
* Connected to example.net port 8081 (#0)
* ALPN, offering http/1.1
* successfully set certificate verify locations:
* CAfile: E:\ca.pem
CApath: none
* TLSv1.3 (OUT), TLS …Run Code Online (Sandbox Code Playgroud)