0

我有通过从流中读取一些字节来检测 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,那么我们必须进行握手,但没有这个字节 - 握手不应该发生。

如何解决这个问题呢?

4

0 回答 0