Registry / http-networking / tls-parser

tls-parser

JSON →
library2.0.2pypypiunverified

tls-parser is a small library to parse TLS records. Current version 2.0.2 supports Python >=3.8. It provides classes like TlsRecord, TlsHandshake, and parsing of TLS 1.2 and 1.3. The library appears to be in maintenance mode with infrequent releases.

pip install tls-parser
INSTALL
IMPORT
SIG · TLS-PARSER
T
tls-parser
http-networkingpythonv2.0.2
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

TlsRecord
from tls_parser import TlsRecord
from tls_parser import TlsRecord

Parses a raw TLS record from bytes and prints the record type and TLS version.

from tls_parser.tls_record import TlsRecord from tls_parser.tls_version import TlsVersionEnum # Parse a TLS record from raw bytes (example: TLS 1.2 handshake) raw_bytes = bytes.fromhex('16030300a2' + '00' * 162) # Minimal handshake record = TlsRecord.from_bytes(raw_bytes) print('Record type:', record.record_type) print('TLS version:', TlsVersionEnum(record.tls_version).name)
Debug
Known issues
breakingIn version 2.0.0, the package name changed from 'tls_parser' to 'tls-parser' on PyPI, and the top-level module name changed accordingly. Old imports from 'tls_parser' may still work if the package is installed, but code relying on the old module layout may break.
fix
Use 'pip install tls-parser' and update imports to match current module structure (e.g., from tls_parser.tls_record import TlsRecord).
affects: 2.0.0 and later
gotchaThe library expects raw bytes of a full TLS record (including the 5-byte header). If you pass an incomplete record or omit the header, parsing will fail or produce incorrect results.
fix
Ensure the input bytes include the TLS record header (content type, version, length) and the correct number of payload bytes as specified in the length field.
affects: all
deprecatedThe package has not been updated since 2021 and may not support recent TLS extensions or newer Python versions beyond 3.8.
fix
Consider using alternatives like 'pycryptodome' or 'scapy' for TLS parsing if you need ongoing support.
affects: all
Upgrade
Version history
2.0.2latest on PyPI · released Apr 6, 2025
Audit
Dependencies

No dependency data recorded yet.

Agent activity
38 hits · last 30 days
node
34
OpenAI (training)
1
Resources
tls-parser — pip install tls-parser · libregistry