eduardsui / tlse

Single C file TLS 1.2/1.3 implementation, using tomcrypt as crypto library
Other
546 stars 90 forks source link

Growtopia wont respond when using TLSe #76

Closed GuckTubeYT closed 1 year ago

GuckTubeYT commented 1 year ago

Hello, i want to make Growtopia HTTPS Server using TLSe, but, Growtopia didnt respond the HTTPS Server?

When i am using Node JS, Its work, but, when i am using TLSe, it didnt respond

Node JS

image

TLSe

image

I am using https://github.com/eduardsui/tlse/blob/master/examples/tlssimpleserver.c for the example and i am change the msg

const char msg[] = "HTTP/1.1 200 OK\r\nContent-length: 31\r\nContent-type: text/plain\r\n\r\nHello world from TLSe (TLS 1.2)";

to

const char msg[] = "HTTP/1.1 404 Not Found\r\nContent-length: 31\r\nContent-type: text/plain\r\n\r\nHello world from TLSe (TLS 1.2)";

i make it to 404 Not Found to Check the Growtopia is Respond the TLSe or not, but the Growtopia still not respond the TLSe

Debug Log

1          SEQUENCE
1.1          SEQUENCE
1.1.1          CONTEXT-SPECIFIC
1.1.1.1          INTEGER(1): 02
1.1.2.1        INTEGER(20): 1C A3 A5 68 4B 1C BF 5D B8 BE 3B 95 EB 97 B6 E3 52 4C 50 68
1.1.3.1        SEQUENCE
1.1.3.1          OBJECT IDENTIFIER(9): 2A 86 48 86 F7 0D 01 01 0B
1.1.3.2          NULL
1.1.4.2        SEQUENCE
1.1.4.1          EMBEDDED PDV
1.1.4.1.1          SEQUENCE
1.1.4.1.1.1          OBJECT IDENTIFIER(3): 55 04 03
1.1.4.1.1.2          STR: [gitu?]
1.1.5.1.1.2    SEQUENCE
1.1.5.1.1.2      UTC TIME: [230118132929Z]
1.1.5.2.1.2      UTC TIME: [240118132929Z]
1.1.6.2.1.2    SEQUENCE
1.1.6.1.1.2      EMBEDDED PDV
1.1.6.1.1.2        SEQUENCE
1.1.6.1.1.1          OBJECT IDENTIFIER(3): 55 04 03
1.1.6.1.1.2          STR: [gitu?]
1.1.7.1.1.2    SEQUENCE
1.1.7.1.1.2      SEQUENCE
1.1.7.1.1.2        OBJECT IDENTIFIER(9): 2A 86 48 86 F7 0D 01 01 01
1.1.7.1.2.2        NULL
1.1.7.2.2.2      BITSTREAM(271): 00 30 82 01 0A 02 82 01 01 00 E4 3E 77 6C 83 52 8A 00 8E A1 C4 10 3E B9 62 8D B3 33 8B E0 03 6D 7B 19 35 C2 BD 19 C2 A7 2C 98 94 8B 38 20 6C FF F8 C2 DA C1 16 15 F2 EE DF 6D 56 1E 6A E0 1C 34 91 19 33 BC 27 36 44 CF A5 EE F8 95 3C 08 18 CD 24 4B 39 C9 B2 77 C3 F0 C2 4F 0A 8A D8 3A C0 25 AD 0C 78 A9 4E 8D 9F A8 6E B5 A0 A4 65 12 21 47 9F 58 EA 24 C0 B1 97 F3 9B A8 4E 0C 96 9D D0 90 61 E7 30 53 06 A6 01 24 FB 46 8D B0 50 E8 0C 7C A8 3A 56 D4 71 15 DF A1 E3 51 E8 A5 23 6C D2 89 66 A0 62 8E 9E F9 D2 C6 FC 81 CC 9C 5F D1 27 74 45 0E EB DE C9 42 B8 C2 DF E1 A1 77 DC B2 DD D0 37 6F 5F 28 67 30 C2 A7 CC 3E 74 AE D7 DB 34 A0 BE 0A 97 60 1F 42 86 55 56 13 BC DD C3 6A B6 59 C9 F4 E5 73 A8 67 3A 90 65 A0 DB E5 94 FC DF 43 1E 5E 8B 98 4D C9 D9 98 06 25 66 64 99 EF 1C 23 6A 31 4B 3F 56 90 2F C0 BD 9D 02 03 01 00 01
1.1.7.2.1.2        SEQUENCE
1.1.7.2.1.1          INTEGER(257): 00 E4 3E 77 6C 83 52 8A 00 8E A1 C4 10 3E B9 62 8D B3 33 8B E0 03 6D 7B 19 35 C2 BD 19 C2 A7 2C 98 94 8B 38 20 6C FF F8 C2 DA C1 16 15 F2 EE DF 6D 56 1E 6A E0 1C 34 91 19 33 BC 27 36 44 CF A5 EE F8 95 3C 08 18 CD 24 4B 39 C9 B2 77 C3 F0 C2 4F 0A 8A D8 3A C0 25 AD 0C 78 A9 4E 8D 9F A8 6E B5 A0 A4 65 12 21 47 9F 58 EA 24 C0 B1 97 F3 9B A8 4E 0C 96 9D D0 90 61 E7 30 53 06 A6 01 24 FB 46 8D B0 50 E8 0C 7C A8 3A 56 D4 71 15 DF A1 E3 51 E8 A5 23 6C D2 89 66 A0 62 8E 9E F9 D2 C6 FC 81 CC 9C 5F D1 27 74 45 0E EB DE C9 42 B8 C2 DF E1 A1 77 DC B2 DD D0 37 6F 5F 28 67 30 C2 A7 CC 3E 74 AE D7 DB 34 A0 BE 0A 97 60 1F 42 86 55 56 13 BC DD C3 6A B6 59 C9 F4 E5 73 A8 67 3A 90 65 A0 DB E5 94 FC DF 43 1E 5E 8B 98 4D C9 D9 98 06 25 66 64 99 EF 1C 23 6A 31 4B 3F 56 90 2F C0 BD 9D
1.1.7.2.1.2          INTEGER(3): 01 00 01
1.1.8.2.1.2    CONSTRUCTED BITSTREAM
1.1.8.1.1.2      SEQUENCE
1.1.8.1.1.2        SEQUENCE
1.1.8.1.1.1          OBJECT IDENTIFIER(3): 55 1D 0E
1.1.8.1.1.2          1.1.8.1.1.2.1            1.1.8.1.2.2.1.1        SEQUENCE
1.1.8.1.2.1.1.1          OBJECT IDENTIFIER(3): 55 1D 23
1.1.8.1.2.2.1.1          1.1.8.1.2.2.1.1            SEQUENCE
1.1.8.1.2.2.1.1              END OF CONTENT
1.1.8.1.3.2.1.1        SEQUENCE
1.1.8.1.3.1.1.1          OBJECT IDENTIFIER(3): 55 1D 13
1.1.8.1.3.2.1.1          BOOLEAN: 255
1.1.8.1.3.3.1.1          1.1.8.1.3.3.1.1            SEQUENCE
1.1.8.1.3.3.1.1              BOOLEAN: 255
1.1.8.1.4.3.1.1        SEQUENCE
1.1.8.1.4.1.1.1          OBJECT IDENTIFIER(3): 55 1D 11
1.1.8.1.4.2.1.1          1.1.8.1.4.2.1.1            SEQUENCE
1.1.8.1.4.2.1.1              INTEGER(14): 67 72 6F 77 74 6F 70 69 61 31 2E 63 6F 6D  => SUBJECT ALTERNATIVE NAME: growtopia1.com
1.1.8.1.4.2.1.2              INTEGER(18): 77 77 77 2E 67 72 6F 77 74 6F 70 69 61 31 2E 63 6F 6D  => SUBJECT ALTERNATIVE NAME: www.growtopia1.com
1.1.8.1.4.2.1.3              INTEGER(14): 67 72 6F 77 74 6F 70 69 61 32 2E 63 6F 6D  => SUBJECT ALTERNATIVE NAME: growtopia2.com
1.1.8.1.4.2.1.4              INTEGER(18): 77 77 77 2E 67 72 6F 77 74 6F 70 69 61 32 2E 63 6F 6D  => SUBJECT ALTERNATIVE NAME: www.growtopia2.com
1.1.8.1.5.2.1.4        SEQUENCE
1.1.8.1.5.1.1.4          OBJECT IDENTIFIER(3): 55 1D 0F
1.1.8.1.5.2.1.4          1.1.8.1.5.2.1.4            BITSTREAM(2): 07 80
1.1.8.1.5.2.1.1              ========> NOT SUPPORTED 7
1.1.8.1.6.2.1.1        SEQUENCE
1.1.8.1.6.1.1.1          OBJECT IDENTIFIER(3): 55 1D 25
1.1.8.1.6.2.1.1          1.1.8.1.6.2.1.1            SEQUENCE
1.1.8.1.6.2.1.1              OBJECT IDENTIFIER(8): 2B 06 01 05 05 07 03 01
1.2.8.1.6.2.1.1  SEQUENCE
1.2.1.1.6.2.1.1    OBJECT IDENTIFIER(9): 2A 86 48 86 F7 0D 01 01 0B
1.2.2.1.6.2.1.1    NULL
1.3.2.1.6.2.1.1  BITSTREAM(257): 00 B3 BB 6A 3B 14 BD 26 7C AE C8 D4 FB 2D 76 EF 7A E5 EC EB C6 62 8B D8 9A 7B D8 13 02 05 5A 7B 39 D8 88 E0 11 68 88 C9 28 B3 CB C7 A0 2E E9 6D 5D 23 B5 2F 53 C1 0D 77 B5 E5 9F E7 10 6C 09 D8 5D 06 7B CE 97 B2 34 01 C0 63 AE 6C 59 F8 1A 7D 96 43 97 84 00 26 1C 07 BA 19 A9 20 09 92 42 B5 BD 49 10 E6 EE E1 AF 0B 13 DE C1 C4 C9 A6 1C 92 0C 16 45 80 FD 6F 91 33 CA 70 30 DE 82 49 CD 71 C6 F4 0F A7 F7 4E 0C 69 EE 22 88 F1 61 B3 7A 3E 3B 09 6B A0 F0 E7 77 C1 31 BB 11 75 D3 FE E7 D9 07 F0 C6 2E 97 E0 71 07 26 F7 E6 49 FB C6 6D 98 73 11 3B 9F C2 D2 FF 30 E0 E0 1F C6 76 9D 8D 8E 08 D4 E6 A6 1D 89 86 CC E7 2F 72 07 FB D7 35 24 5E 11 4C CA A7 46 36 57 02 A8 95 8B B3 55 AC 75 1A C8 86 29 C5 BD 7C A1 11 53 25 E6 76 6E 73 35 24 CD A0 78 23 91 E2 28 3B E1 22 74 8A 17 B9 94 08
SIGN SHA256
FINGERPRINT (32): 8D 80 57 58 5D A4 17 A6 F4 4B 84 9B 81 64 02 51 95 07 51 4A CE 9A FA 4A E9 84 3E DF 49 16 0D A8
WARNING - parse error (private key encountered in certificate)
Loaded certificate: 1
1          SEQUENCE
1.1          INTEGER(1): 00
1.2          SEQUENCE
1.2.1          OBJECT IDENTIFIER(9): 2A 86 48 86 F7 0D 01 01 01
1.2.2          NULL
1.3.2        1.3.1          SEQUENCE
1.3.1.1          INTEGER(1): 00
1.3.1.2          INTEGER(257): 00 E4 3E 77 6C 83 52 8A 00 8E A1 C4 10 3E B9 62 8D B3 33 8B E0 03 6D 7B 19 35 C2 BD 19 C2 A7 2C 98 94 8B 38 20 6C FF F8 C2 DA C1 16 15 F2 EE DF 6D 56 1E 6A E0 1C 34 91 19 33 BC 27 36 44 CF A5 EE F8 95 3C 08 18 CD 24 4B 39 C9 B2 77 C3 F0 C2 4F 0A 8A D8 3A C0 25 AD 0C 78 A9 4E 8D 9F A8 6E B5 A0 A4 65 12 21 47 9F 58 EA 24 C0 B1 97 F3 9B A8 4E 0C 96 9D D0 90 61 E7 30 53 06 A6 01 24 FB 46 8D B0 50 E8 0C 7C A8 3A 56 D4 71 15 DF A1 E3 51 E8 A5 23 6C D2 89 66 A0 62 8E 9E F9 D2 C6 FC 81 CC 9C 5F D1 27 74 45 0E EB DE C9 42 B8 C2 DF E1 A1 77 DC B2 DD D0 37 6F 5F 28 67 30 C2 A7 CC 3E 74 AE D7 DB 34 A0 BE 0A 97 60 1F 42 86 55 56 13 BC DD C3 6A B6 59 C9 F4 E5 73 A8 67 3A 90 65 A0 DB E5 94 FC DF 43 1E 5E 8B 98 4D C9 D9 98 06 25 66 64 99 EF 1C 23 6A 31 4B 3F 56 90 2F C0 BD 9D
1.3.1.3          INTEGER(3): 01 00 01
1.3.1.4          INTEGER(256): 01 FD 87 76 13 49 17 79 FC C4 6D 5C C4 E7 41 F4 41 61 4C 31 76 66 30 82 1E 45 65 F7 C1 0A 4B 29 C3 75 D9 55 F3 0D 62 62 74 9C E5 6F E8 8F EB B3 DC E1 E4 05 B3 49 44 10 A7 B2 56 D7 32 CF 6A BF 84 3C 6C EB 17 28 46 CE 3F 21 42 A4 A7 B9 44 40 83 33 85 C2 31 65 C2 B6 0E A1 4F 55 8D D4 5E AE C7 C9 57 36 4A C3 00 A1 3A 5D 7A AE B1 C8 06 8D F7 AC 45 6D F7 E1 22 71 6D 2A F4 2E 63 69 2A A5 C5 23 2F 2F 84 01 05 60 25 A9 DE A1 B8 E0 27 BC C5 0B 6A 6C D3 4D 06 4C 80 FC 44 B0 71 1F 22 EE B3 3E 9E 0F 9D 11 9B B0 13 F5 F3 2B 15 75 AC C8 FF 37 CA AA D1 8A A7 9F 7E 1C 39 48 11 2B C5 CD 64 BF AA E2 02 B8 30 79 3C E3 35 38 9B 06 A9 C6 43 56 F4 B4 6F FC 21 4B BC A5 47 1B D1 6E 76 11 6F 1E 67 D0 5C D4 A7 A0 3E 9F D8 D9 81 06 E6 35 77 F5 BF B2 F8 69 25 C8 52 62 59 62 17 A4 EF 31
1.3.1.5          INTEGER(129): 00 E7 13 E5 0A 73 13 F4 57 20 AC B2 05 01 9A 13 DC 3B B0 3B 1F C5 FF 3A 1B CE 2D 74 E9 5B A8 D5 F4 8B F8 C7 5D 4B 71 DB E1 99 11 F9 15 B4 74 1C 0B B7 41 6D E4 76 57 4B B8 B1 0B 10 E1 2C D5 A2 8D B9 8B DB E0 4D 78 60 5D 9A 02 41 AD 8D DD D5 E7 90 55 21 CC 5F AF A8 B7 D7 65 31 00 BC FF E3 A4 CF E8 23 BA BF 85 AA 70 45 09 80 EE 55 43 C9 74 ED 75 F5 4D D8 46 BA F4 01 4E DF 0F 2F D2 BB C9
1.3.1.6          INTEGER(129): 00 FC DC 55 27 A6 28 B3 5D 42 3E 02 E3 65 CF FD A1 AB FA 4B DC 4A 33 01 0D F8 98 DA E8 75 83 CF 46 9F 3C A7 CD 9D 32 AC 82 5D C3 1F E5 10 82 9D E8 47 7A CB B4 8D C8 94 BF 16 2A 26 EC 29 B6 D9 A8 6B D2 BE 4E D8 BB E0 82 0C 9E FE 24 33 B2 F1 4F BC 00 6F B8 75 51 88 FF 43 CD 9F E5 76 F1 B6 37 8A 28 79 A6 2C B8 FE 2A A2 CB 0F 71 A2 29 20 F9 DC 0D ED 8B F0 44 85 5E CF 59 9D 28 4B 65 75 35
1.3.1.7          INTEGER(128): 18 E3 B0 B0 EE 72 40 C8 3D B1 BC 3F 03 CC 27 C5 79 FC 62 71 EA AE B2 00 9A B5 94 B9 29 F1 46 92 5F 9D 3D 44 14 43 40 4E CD 60 FD 36 54 48 89 58 CD B5 53 73 DF 37 49 E5 AB D4 28 4E 48 B8 FE 18 4B DA FF A4 EA 53 43 F5 F1 07 BB 31 49 6D 92 83 AD AD 2D C5 C8 AC AF FC 95 4B C5 FA 71 61 12 91 06 FF D7 11 5F 5D B3 5D 02 62 A2 AB 89 2D 92 FE 70 31 5B 69 B6 18 F0 3C 26 03 EB CC C3 F6 EB D9
1.3.1.8          INTEGER(128): 24 60 3E 0F DA 23 78 CA 2D C1 66 00 F8 A0 97 48 2E C9 6F 28 5D B4 40 AE 95 D8 C7 85 31 82 A8 CA EC 15 79 BE 66 A2 E7 96 49 8E CC 83 D3 80 36 DF 37 89 3E CC D6 A8 C8 5D 44 FF 03 62 6E 0D D3 FA 1A A8 D2 9F DD 26 0A 02 2B 76 A3 F0 E9 4F 10 CF FB A7 C4 6A B0 D5 ED F3 6A F9 A5 CB 08 F5 74 D5 40 96 DA 09 41 DD CB 12 AF 20 AF 34 15 B3 FC FE 74 DD BC 12 A9 99 F1 E5 D5 C6 7A 89 55 6F 5F 11
1.3.1.9          INTEGER(128): 4A F0 B5 34 B7 EF 99 EF 5B 84 6F 7A DB EA 81 BF B2 14 19 D1 B0 CC 6E DF 6E 2A A2 1C AB A1 1B 24 58 4D 06 E0 20 E4 7D 23 81 6A F4 AB 34 6D 42 49 EC 34 6A 5C 06 A7 68 7E 03 AC DB 0F F2 A9 D5 10 1B 56 46 9D 75 5F A6 46 04 D2 98 1B 19 73 BD EF E7 72 FF 73 A1 9A 9C 68 E5 6C A9 0F 15 7E 2F FB 8B C1 46 3F A4 55 35 71 D1 D0 D7 B2 D5 2F 00 1B 9E E1 F0 E8 D2 03 14 A2 55 2E 55 57 46 CE 85 B9
Loaded private key
Message type: 16, length: 512
HANDSHAKE MESSAGE
 => CLIENT HELLO
VERSION REQUIRED BY REMOTE 303, VERSION NOW 304
Extension: 0x00 (0), len: 23
SNI HOST INDICATOR: [www.growtopia1.com]
Extension: 0x0b (11), len: 4
SUPPORTED POINT FORMATS (4): 03 00 01 02
Extension: 0x0a (10), len: 28
SUPPORTED GROUPS (26): 00 17 00 19 00 1C 00 1B 00 18 00 1A 00 16 00 0E 00 0D 00 0B 00 0C 00 09 00 0A
SELECTED CURVE secp256r1
Extension: 0x0d (13), len: 32
SUPPORTED SIGNATURES (32): 00 1E 06 01 06 02 06 03 05 01 05 02 05 03 04 01 04 02 04 03 03 01 03 02 03 03 02 01 02 02 02 03
Extension: 0x0f (15), len: 1
Extension: 0x03374 (13172), len: 0
Extension: 0x010 (16), len: 11
Extension: 0x015 (21), len: 206
 => DTLS COOKIE VERIFIED: 0 (511)
<= SENDING SERVER HELLO
Initializing dependencies
<= SENDING CERTIFICATE
<= SENDING EPHEMERAL DH KEY
Signing OK! (length 256)
<= SENDING DONE
Consumed 517 bytes
Message type: 16, length: 70
HANDSHAKE MESSAGE
 => CLIENT KEY EXCHANGE
OUT_SIZE: 32
ECC DHE (32): 24 E8 A1 2D 71 40 BB 7B 21 1E 96 7C FB 76 69 19 91 4E 81 E0 37 23 0B CA D9 34 19 67 1F F2 C5 B1
PRE MASTER KEY (32): 24 E8 A1 2D 71 40 BB 7B 21 1E 96 7C FB 76 69 19 91 4E 81 E0 37 23 0B CA D9 34 19 67 1F F2 C5 B1

=========== Master key ===========
24 21 0B 27 2D 46 A5 F3 28 EB 76 B5 87 F9 B6 B5 E4 15 EE 1E BA E5 C2 7D 08 2F AC 17 EC EE 80 42 F7 3E 45 97 F2 3E 39 17 6B 8F F7 F6 B5 CE 17 B0
LOCAL RANDOM  (32): 5D 27 B3 6B 5C EA A8 2D 43 A9 D0 13 FF 5E 3E EA B2 43 1D 10 82 5D 86 0D 47 6D 58 58 B8 76 22 02
REMOTE RANDOM (32): CA 48 37 D3 1B 41 72 03 C2 E7 C7 ED 08 C1 13 35 C6 5C 61 58 42 DA DC 04 8E AE 5E F5 F0 25 AE 5B

=========== EXPANSION ===========
E1 30 36 72 48 3C 88 53 BB 3A B3 68 5F 34 E5 1D D5 83 1F E1 22 68 1A 37 C9 30 25 32 ED 72 75 0C E4 2E 38 74 1C 32 42 0E C0 89 68 66 F4 4E F0 3B A6 0E A3 B7 0C 72 7D 92 91 2A EA 70 9B 69 F3 75 9F 3A EC FD 4B 34 EA D0 4E 69 C8 42 0E 76 F3 29 5D 08 33 70 E2 37 A0 E7 39 3E 04 68 C5 DD 04 B5 83 3F B4 46 94 98 8D FB DB 05 CE CB 80 01 16 24 2E 4C 44 48 40 06 C1 06 B4 67 30 AD 24 1B F2 CC 7B 6F 55 7F 2F 7C 2F 58 D9 B4 C8 0A B7 BD 1E 5F F5 37 03 35 61 4E BF D1 AD E1 14 D3 4B B6 CE E0 08 8B C7 69 1F 05 A3 B9 B8 36 C1 68 DB AA 06 84 56 34 12 7B 42 FB 96 8B 49 90 48 C4 EC BF 78 78
EXPANSION 72/192
CLIENT KEY (32): E1 30 36 72 48 3C 88 53 BB 3A B3 68 5F 34 E5 1D D5 83 1F E1 22 68 1A 37 C9 30 25 32 ED 72 75 0C
CLIENT IV (4): 9F 3A EC FD
CLIENT MAC KEY (48): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
SERVER KEY (32): E4 2E 38 74 1C 32 42 0E C0 89 68 66 F4 4E F0 3B A6 0E A3 B7 0C 72 7D 92 91 2A EA 70 9B 69 F3 75
SERVER IV (4): 4B 34 EA D0
SERVER MAC KEY (48): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
Using cipher ID: c030

Consumed 75 bytes
Message type: 14, length: 1
CHANGE CIPHER SPEC MESSAGE
Consumed 6 bytes
Message type: 16, length: 40
encrypted (40): 44 8E 7A CD 5C 58 3C 04 6B AD 85 A9 56 D6 45 EF 2F 86 9D E0 1D 59 F7 C7 4D 00 31 EE B4 D6 12 BE F6 6B D5 27 2B E9 3D 9B
aad (13): 00 00 00 00 00 00 00 00 16 03 03 00 10
aad iv (12): 9F 3A EC FD 44 8E 7A CD 5C 58 3C 04
PT SIZE: 16
decrypted (16): 14 00 00 0C 4B CC 55 52 5A 24 7F E0 56 1B 84 04
tag (16): 4D 00 31 EE B4 D6 12 BE F6 6B D5 27 2B E9 3D 9B
HANDSHAKE MESSAGE
 => FINISHED
VERIFY DATA (12): C2 0E D5 29 F8 6E BE 96 91 B1 D7 32
Consumed 21 bytes
Cipher ECDHE-RSA-AES256GCM-SHA384
Message type: 17, length: 241
encrypted (241): 44 8E 7A CD 5C 58 3C 05 45 E9 FB 23 DE 72 97 F5 44 1A 84 C7 05 5C 1C BB 7A 63 B8 30 16 F4 9D 60 E4 B9 57 16 05 00 94 CC 1F DD 2D AA 57 52 69 0E F6 8E 9B 48 16 A5 AE 44 94 A1 C8 15 ED B9 7F 8E 2C 7C 4E 48 D0 CB AF 61 3E CF 5E 27 E4 2E 9C 6A 7F F4 49 F0 1C D8 AB 84 25 7C 5F 81 A9 80 D1 5B BD DD 24 B5 B5 2A 6F 2B 69 1E 58 A5 A6 9A 56 F3 F1 97 AB CB BD 17 0E 90 B3 98 BB 54 E0 AD 93 65 9C A6 4C 46 8A AA 0A D9 8F 0B A2 7C 19 2B DF E4 38 1F DC 6D F8 C1 D6 FF 7F A4 7D 23 86 10 A8 52 6E A8 F7 D7 66 0C CE F6 F8 09 9B 23 1D EA 30 EA C0 17 A3 B9 9D AA CD 28 16 F6 0A 8F CC ED 37 33 18 27 83 4F 77 B6 D7 FC BD 61 72 F2 67 94 FC 46 87 9C 18 63 AA 07 23 1B FF 5C 06 95 EE C5 3A 0F BA 7C D4 3F 9B FC 48 B8 38 29 4C 6D 0B 82 B9 F1 20
aad (13): 00 00 00 00 00 00 00 01 17 03 03 00 D9
aad iv (12): 9F 3A EC FD 44 8E 7A CD 5C 58 3C 05
PT SIZE: 217
decrypted (217): 50 4F 53 54 20 2F 67 72 6F 77 74 6F 70 69 61 2F 73 65 72 76 65 72 5F 64 61 74 61 2E 70 68 70 20 48 54 54 50 2F 31 2E 31 0D 0A 48 6F 73 74 3A 20 77 77 77 2E 67 72 6F 77 74 6F 70 69 61 31 2E 63 6F 6D 0D 0A 55 73 65 72 2D 41 67 65 6E 74 3A 20 55 62 69 53 65 72 76 69 63 65 73 5F 53 44 4B 5F 32 30 31 39 2E 52 65 6C 65 61 73 65 2E 32 37 5F 50 43 36 34 5F 75 6E 69 63 6F 64 65 5F 73 74 61 74 69 63 0D 0A 41 63 63 65 70 74 3A 20 2A 2F 2A 0D 0A 43 6F 6E 74 65 6E 74 2D 54 79 70 65 3A 20 61 70 70 6C 69 63 61 74 69 6F 6E 2F 78 2D 77 77 77 2D 66 6F 72 6D 2D 75 72 6C 65 6E 63 6F 64 65 64 0D 0A 43 6F 6E 74 65 6E 74 2D 4C 65 6E 67 74 68 3A 20 33 36 0D 0A 0D 0A
tag (16): 7C D4 3F 9B FC 48 B8 38 29 4C 6D 0B 82 B9 F1 20
APPLICATION DATA MESSAGE (TLS VERSION: 303):
POST /growtopia/server_data.php HTTP/1.1
Host: www.growtopia1.com
User-Agent: UbiServices_SDK_2019.Release.27_PC64_unicode_static
Accept: */*
Content-Type: application/x-www-form-urlencoded
Content-Length: 36

Consumed 222 bytes
CLOSE

Build command gcc tlssimpleserver.c -lws2_32 -lwinmm -DTLS_AMALGAMATION

Please help me

eduardsui commented 1 year ago

Hello,

From the debug output it seems that the connecion is correctly established (you receive the POST request). Also, you have the content-length set, but the actual content is missing. I think the problem is in the http server (the example is a simple less-than-minimal webserver). Maybe check if you received the full request before sending 404? If you test it from a web browser, what response do you get?

GuckTubeYT commented 1 year ago

Hello,

From the debug output it seems that the connecion is correctly established (you receive the POST request). Also, you have the content-length set, but the actual content is missing. I think the problem is in the http server (the example is a simple less-than-minimal webserver). Maybe check if you received the full request before sending 404? If you test it from a web browser, what response do you get?

the result from browser is 404, and its work perfectly, but, on growtopia, it wont respond, i dont know why

GuckTubeYT commented 1 year ago

is it problem on cipher? or the msg header?

GuckTubeYT commented 1 year ago

okay, so when i try to check the cipher using Node JS

and the result is this

image

Is it possible to change the cipher in TLSe?

GuckTubeYT commented 1 year ago

Hello,

From the debug output it seems that the connecion is correctly established (you receive the POST request). Also, you have the content-length set, but the actual content is missing. I think the problem is in the http server (the example is a simple less-than-minimal webserver). Maybe check if you received the full request before sending 404? If you test it from a web browser, what response do you get?

btw, on browser is work

image

GuckTubeYT commented 1 year ago

hmmmm... when i try to check the Server Hello Length, its different image and the length between TLSe and Node JS (HTTPS Server) is different image

is it okay or not?

eduardsui commented 1 year ago

Yes, it is perfectly fine. The difference is from the extension list (one is 23 bytes longer than the other). Most tls extensions are not mandatory, so no problem there.

GuckTubeYT commented 1 year ago

Yes, it is perfectly fine. The difference is from the extension list (one is 23 bytes longer than the other). Most tls extensions are not mandatory, so no problem there.

ohh, is it possible to add that? so, i want to make the length byte same like node js

eduardsui commented 1 year ago

It is a little more complex than that. “Advertising” an extension implies support for it. The “renegotiation” extension is not required for a TLS connection. Also, keep in mind that the TLS layer is just fine, as shown in your first comment. The plain text data is fine. If you have had a problem with the TLS data and/or negotiation, you wouldn’t be able to see the plain text data (the POST data). Try to ensure that you read the whole data and your entire data is written before the socket is closed. I personally think that this is the problem. Keep in mind that the examples are not fully functional web servers (you need to write one or to use one).

As an experiment, add a sleep of about 1 second before closing the socket. Also, check the result of send/write APIs.

APPLICATION DATA MESSAGE (TLS VERSION: 303): POST /growtopia/server_data.php HTTP/1.1 Host: www.growtopia1.com User-Agent: UbiServices_SDK_2019.Release.27_PC64_unicode_static Accept: / Content-Type: application/x-www-form-urlencoded Content-Length: 36

This means that your TLS negotiation and data layer are fine.

GuckTubeYT commented 1 year ago

It is a little more complex than that. “Advertising” an extension implies support for it. The “renegotiation” extension is not required for a TLS connection. Also, keep in mind that the TLS layer is just fine, as shown in your first comment. The plain text data is fine. If you have had a problem with the TLS data and/or negotiation, you wouldn’t be able to see the plain text data (the POST data). Try to ensure that you read the whole data and your entire data is written before the socket is closed. I personally think that this is the problem. Keep in mind that the examples are not fully functional web servers (you need to write one or to use one).

As an experiment, add a sleep of about 1 second before closing the socket. Also, check the result of send/write APIs.

APPLICATION DATA MESSAGE (TLS VERSION: 303): POST /growtopia/server_data.php HTTP/1.1 Host: www.growtopia1.com User-Agent: UbiServices_SDK_2019.Release.27_PC64_unicodestatic Accept: /_ Content-Type: application/x-www-form-urlencoded Content-Length: 36

This means that your TLS negotiation and data layer are fine.

i just add the sleep(1); before close the socket, its still doesnt work.

maybe i want to try to modify http library, like sandbird

GuckTubeYT commented 1 year ago

image

I am using win32-c-http but, the growtopia still wont respond, i dont know why

GuckTubeYT commented 1 year ago

image

I am using win32-c-http but, the growtopia still wont respond, i dont know why

even i add the Sleep(1000); code

image

GuckTubeYT commented 1 year ago

Oh finally, its fixed, so, you right, i must add the Sleep() code, and make it to 0.5

GuckTubeYT commented 1 year ago

Solved, thanks @eduardsui