简体   繁体   English

为什么使用HttpClient HTTPS请求时标头和正文未加密?

[英]Why is header and body not encrypted when using HttpClient HTTPS requests?

Consider the following function: 考虑以下功能:

private string ServerUrl = "https://api.myserver.com";

public async Task<T> PostRequest<T>(string hook, HttpContent content)
{
    try
    {
        var response = await http.PostAsync(ServerUrl + hook, content);
        var contentString = await response.Content.ReadAsStringAsync();

        return Serializer.ToJsonObject<T>(contentString);
    }
    catch
    {
        return default(T);
    }
}

Now it works correctly, but as I'm making requests to HTTPS shouldn't header and body be encrypted? 现在它可以正常工作,但是当我向HTTPS发出请求时,标题和正文是否应该加密?

I'm checking things with Fiddler v4 and it isn't. 我正在使用Fiddler v4进行检查,事实并非如此。

Is there something I am missing or don't quite understand how that should work? 我有什么想念的东西吗?

My server uses LetsEncrypt! 我的服务器使用LetsEncrypt! Self-signed certificate. 自签名证书。

Fiddler can decrypt the content before it's displayed to you in the UI. Fiddler可以解密内容,然后再在UI中显示给您。 Do you have this setting enabled? 是否启用了此设置?

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM