Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/276.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 为什么在使用HttpClient HTTPS请求时头和体未加密?_C#_Apache_Http - Fatal编程技术网

C# 为什么在使用HttpClient HTTPS请求时头和体未加密?

C# 为什么在使用HttpClient HTTPS请求时头和体未加密?,c#,apache,http,C#,Apache,Http,考虑以下功能: 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 cont

考虑以下功能:

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);
    }
}
私有字符串服务器URL=”https://api.myserver.com";
公共异步任务PostRequest(字符串挂钩,HttpContent)
{
尝试
{
var response=wait http.PostAsync(ServerUrl+hook,content);
var contentString=await response.Content.ReadAsStringAsync();
返回Serializer.ToJsonObject(contentString);
}
抓住
{
返回默认值(T);
}
}
现在它可以正常工作了,但当我向HTTPS发出请求时,头和体不应该被加密吗

我正在用Fiddler v4进行检查,但事实并非如此

是否有什么东西我遗漏了或不太明白该怎么做


我的服务器使用LetsEncrypt!自签名证书。

Fiddler可以在内容显示在UI中之前对其进行解密。是否已启用此设置


这意味着任何窃听它的人都可以轻松解密它?只有同时设置了Fiddler和浏览器,Fiddler才能拦截加密的流量。通常,头和正文不能被截取。@ J.DOE。不,发生了什么事,小提琴手在机器中安装证书,并在中间代理服务器连接(提示您允许它)。然后,它使用其证书代表您发出HTTPS请求。然后它可以解密HTTPS请求。没有该证书的人将无法解密它。