static void Main(string[] args) { TestChilkat(); DoMyTest(); byte[] clientHello = MyBytes.HexStringToByte("16030100c6010000c2030351adaa772a453edd1c42c48e85d98c671e1619b06fa8a88641f27b43d2797a3c00001c5a5ac02bc02fc02cc030cca9cca8c013c014009c009d002f0035000a0100007daaaa0000ff0100010000000014001200000f642e62616977616e6469616e2e636e0017000000230000000d00140012040308040401050308050501080606010201000500050100000000001200000010000e000c02683208687474702f312e3175500000000b00020100000a000a0008aaaa001d001700187a7a000100", HexaDecimal.hex16, ShowHexMode.@null); TLSPacket.TLSPlaintext tp = new TLSPacket.TLSPlaintext(TLSPacket.TLSContentType.Handshake, new TLSPacket.ProtocolVersion(0x03, 0x03)); TLSPacket.ClientHello ch = new TLSPacket.ClientHello("d.baiwandian.cn"); clientHello = tp.CreateRawData(ch.GetProtocolRawData()); Console.ReadLine(); MyTLS myTLS = new MyTLS(); myTLS.Connect(); Console.WriteLine("enter to say [ Handshake - Client Hello ]"); Console.ReadLine(); myTLS.SendData(clientHello); Console.ReadLine(); myTLS.Dispose(); Console.WriteLine("enter to exti"); Console.ReadLine(); }
static void DoMyTest() { Console.ReadLine(); TLSPacket.TLSPlaintext tp = new TLSPacket.TLSPlaintext(TLSPacket.TLSContentType.Handshake, new TLSPacket.ProtocolVersion(0x03, 0x01)); string tempRaw = MyBytes.ByteToHexString(tp.GetRawData(198), HexaDecimal.hex16, ShowHexMode.space); Console.WriteLine(tempRaw); TLSPacket.ClientHello ch = new TLSPacket.ClientHello("d.baiwandian.cn"); tempRaw = MyBytes.ByteToHexString(ch.GetProtocolRawData(), HexaDecimal.hex16, ShowHexMode.space); Console.WriteLine(tempRaw); Console.WriteLine("enter to DoMyTest"); Console.ReadLine(); }