Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/256.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# 检测https流量,然后通过sslstream进行握手_C#_.net_Ssl - Fatal编程技术网

C# 检测https流量,然后通过sslstream进行握手

C# 检测https流量,然后通过sslstream进行握手,c#,.net,ssl,C#,.net,Ssl,我有一个函数,通过从流中读取一些字节来检测Ssl流量: private bool IsSslContent(Stream stream) { var firstLineBytes = new byte[1]; firstLineBytes = stream.ReadByte(); if (firstLineBytes != null) { if ((firstLineBytes[0] == 0x80)

我有一个函数,通过从流中读取一些字节来检测Ssl流量:

private bool IsSslContent(Stream stream)
    {
        var firstLineBytes = new byte[1];
        firstLineBytes = stream.ReadByte();
        if (firstLineBytes != null)
        {
            if ((firstLineBytes[0] == 0x80)||(firstLineBytes[0] == 0x16))
            {
                return true;
            }
        }
        return false;
    }
如果是ssl,那么我们必须进行握手,但是如果没有这个字节,握手就不会发生


如何解决这个问题?

问题是什么?如何检测SSL连接或如何实现握手?如何检测SSL流量,然后使用.net中的sslstream类成功握手。