Outils pour utilisateurs

Outils du site


TLS1.2

Décrit initialement dans la RFC 5246 désormais obsolète et mise à jour par de nombreuses autres RFC. Voir le lien pour la liste complète). TLS1.2 avec HTTPSDans le principe, les échanges entre le client et le serveur se font de la manière suivante:

  1. Le client s'adresse au serveur en lui présentant les suites de chiffrement qu'il sait utiliser;

  2. le serveur répond en indiquant la suite sélectionnée et envoie son certificat X509. Une valeur (pseudo)aléatoire est calculée et envoyée également au client:

  3. le client, avec les informations reçues, finalise une clé de session et l'envoie au serveur;

  4. le serveur entérine la clé

  5. le dialogue chiffré avec la clé de session s'établit.

Dialogue client/serveur

Dans ce qui suit, HTTPS est espionné avec Wireshark. Le serveur nginx est paramétré pour n'utiliser que TLS1.2. Pour améliorer la complexité de la lecture, les protagonistes utilisent leur IPv6:

  • le client : 2a01:e0a:106b:cdf0:ac2a:a7ff:fedd:e607,
  • le serveur: 2a01:e0a:106b:cdf0:7285:c2ff:fe4b:5fdc.

(Oui, ils sont dans la même délégation).

Client Hello

Dans un premier temps, le client s'adresse au serveur en lui exposant toutes ses possibilités d'exploitation de SSL/TLS:

  • les versions TLS possibles (actuellement (juin 2026) 1.2 ou 1.3, les versions précédentes étant dépassées),
  • les suites de chiffrement, de hachage qu'il est capable de manipuler.

L'objectif étant de trouver un point commun avec le serveur. La capture (partielle) Wireshark qui suit montre:

  • les suites cryptographiques que le client sait gérer,
  • les versions TLS supportées,
  • les algorithmes de signature qu'il accepte.

Les parties en italique bleu ne concernent pas TLS1.2, le client supportant également TLS1.3.

Transport Layer Security
    TLSv1.2 Record Layer: Handshake Protocol: Client Hello
        ...
        Handshake Protocol: Client Hello
            ...
            Cipher Suites (17 suites)
                Cipher Suite: TLS_AES_128_GCM_SHA256 (0x1301)
                Cipher Suite: TLS_CHACHA20_POLY1305_SHA256 (0x1303)
                Cipher Suite: TLS_AES_256_GCM_SHA384 (0x1302)
                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)
                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (0xc02f)
                Cipher Suite: TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca9)
                Cipher Suite: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (0xcca8)
                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (0xc02c)
                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (0xc030)
                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (0xc00a)
                Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (0xc009)
                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA (0xc013)
                Cipher Suite: TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (0xc014)
                Cipher Suite: TLS_RSA_WITH_AES_128_GCM_SHA256 (0x009c)
                Cipher Suite: TLS_RSA_WITH_AES_256_GCM_SHA384 (0x009d)
                Cipher Suite: TLS_RSA_WITH_AES_128_CBC_SHA (0x002f)
                Cipher Suite: TLS_RSA_WITH_AES_256_CBC_SHA (0x0035)
            ...
            Extension: key_share (len=1327)
                Type: key_share (51)
                Length: 1327
                Key Share extension
                    Client Key Share Length: 1325
                    Key Share Entry: Group: Unknown (4588), Key Exchange length: 1216
                        Group: Unknown (4588)
                        Key Exchange Length: 1216
                        Key Exchange: 8a8a4f6c01bacd7873cae7c51169be733813e0f4c6b4a45d23d8531f10a4eb6c8de97b1b…
                    Key Share Entry: Group: x25519, Key Exchange length: 32
                        Group: x25519 (29)
                        Key Exchange Length: 32
                        Key Exchange: c39ce197b6a7a135754f23d833a6b0863170cb3ca44ffa591bde4e1675c7ea52
                    Key Share Entry: Group: secp256r1, Key Exchange length: 65
                        Group: secp256r1 (23)
                        Key Exchange Length: 65
                        Key Exchange: 04eccfde6261d958052e6814a124b44da2717536a5d004b3daefaad7cd7b2cf7d75477de…
            ...
            Extension: supported_versions (len=5)
                Type: supported_versions (43)
                Length: 5
                Supported Versions length: 4
                Supported Version: TLS 1.3 (0x0304)
                Supported Version: TLS 1.2 (0x0303)
            Extension: signature_algorithms (len=24)
                Type: signature_algorithms (13)
                Length: 24
                Signature Hash Algorithms Length: 22
                Signature Hash Algorithms (11 algorithms)
                    Signature Algorithm: ecdsa_secp256r1_sha256 (0x0403)
                    Signature Algorithm: ecdsa_secp384r1_sha384 (0x0503)
                    Signature Algorithm: ecdsa_secp521r1_sha512 (0x0603)
                    Signature Algorithm: rsa_pss_rsae_sha256 (0x0804)
                    Signature Algorithm: rsa_pss_rsae_sha384 (0x0805)
                    Signature Algorithm: rsa_pss_rsae_sha512 (0x0806)
                    Signature Algorithm: rsa_pkcs1_sha256 (0x0401)
                    Signature Algorithm: rsa_pkcs1_sha384 (0x0501)
                    Signature Algorithm: rsa_pkcs1_sha512 (0x0601)
                    Signature Algorithm: ecdsa_sha1 (0x0203)
                    Signature Algorithm: rsa_pkcs1_sha1 (0x0201)
            Extension: psk_key_exchange_modes (len=2)
                Type: psk_key_exchange_modes (45)
                Length: 2
                PSK Key Exchange Modes Length: 1
                PSK Key Exchange Mode: PSK with (EC)DHE key establishment (psk_dhe_ke) (1)
...
Le client annonce les suites cryptographiques qu'il sait manipuler, par ordre de préférence. En TLS1.2 seules la seconde et la quatrième sont compatibles.

Server Hello

Le serveur choisit la suite cryptographique dans la liste proposée par le client, envoie son certificat et la clé publique de la parie publique/privée qu'il s'est construit, avec sa signature.

Transport Layer Security
    TLSv1.2 Record Layer: Handshake Protocol: Server Hello
        Content Type: Handshake (22)
        Version: TLS 1.2 (0x0303)
        Length: 82
        Handshake Protocol: Server Hello
            Handshake Type: Server Hello (2)
            Length: 78
            Version: TLS 1.2 (0x0303)
            ...
            Cipher Suite: TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (0xc02b)
        ...
    TLSv1.2 Record Layer: Handshake Protocol: Certificate
        Content Type: Handshake (22)
        Version: TLS 1.2 (0x0303)
        Length: 2056
        Handshake Protocol: Certificate
        ...
        ...
        ...
        ...
    TLSv1.2 Record Layer: Handshake Protocol: Server Key Exchange
        Content Type: Handshake (22)
        Version: TLS 1.2 (0x0303)
        Length: 115
        Handshake Protocol: Server Key Exchange
            Handshake Type: Server Key Exchange (12)
            Length: 111
            EC Diffie-Hellman Server Params
                Curve Type: named_curve (0x03)
                Named Curve: x25519 (0x001d)
                Pubkey Length: 32
                Pubkey: 6a3df53bdcd5d7983e01e960e73ab07fdac0566b0ecadca0f352be010f31f36d
                Signature Algorithm: ecdsa_secp256r1_sha256 (0x0403)
                    Signature Hash Algorithm Hash: SHA256 (4)
                    Signature Hash Algorithm Signature: ECDSA (3)
                Signature Length: 71
                Signature: 3045022072c1e31f76f4126b2c31ad97271ba43932ae163795e8fc05bc111b4445266389…
    TLSv1.2 Record Layer: Handshake Protocol: Server Hello Done
        Content Type: Handshake (22)
        Version: TLS 1.2 (0x0303)
        Length: 4
        Handshake Protocol: Server Hello Done
            Handshake Type: Server Hello Done (14)
            Length: 0
Pour la suite de la capture, une astuce permet à firefox de sauvegarder les clés de session et de les transmettre à wireshark, ce qui permet de décoder les échanges 8-)

Client Key Exchange

Le client envoie sa clé publique au serveur et conclue.

Transport Layer Security
    TLSv1.2 Record Layer: Handshake Protocol: Client Key Exchange
        ...
        Handshake Protocol: Client Key Exchange
            EC Diffie-Hellman Client Params
                Pubkey Length: 32
                Pubkey: fca8d0c4230e51ee9628d81f7eff1df36016cafdb5dc9e6a116c862191a2fb22
    ...
    TLSv1.2 Record Layer: Handshake Protocol: Finished

TLS1.2: Dernière modification le: 14/06/2026 à 14:34 par prof