Skip to main content
PyPI Documentation Status Build & Test Status

This is an implementation of the SSLKEYLOGFILE facility, available in Firefox and Chromium/Google Chrome, that is supported by Wireshark in order to decrypt SSL/TLS connections even when you don’t have the private key, or when using key exchange methods that will prevent decryption even if you do (Such as Diffie-Hellman).

This is for the standard library ssl module, it won’t work for other ssl modules.

Note:

Python 3.8+ includes built-in support for generating an SSL key log file via ssl.SSLContext.keylog_filename, and will also enable it when the SSLKEYLOGFILE environment variable is set when creating a context via ssl.create_default_context.

This package uses the same callback the built-in implementation is using, which will likely cause both implementations to trample each other, causing the other not to work, or other unintended consequences. As such, you should probably not enable both at the same time.

Quick Start

import os
import sslkeylog

sslkeylog.set_keylog(os.environ.get('SSLKEYLOGFILE'))  # Or directly specify a path

# Do anything involving SSL (Using the built-in ssl module)

Set the SSLKEYLOGFILE environment variable if you use it, and set “(Pre)-Master-Secret log filename” in Wireshark’s SSL protocol preferences to the resulting file.

License

MIT License, except OpenSSL which is licensed under it’s own license. See LICENSE.txt

This product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

sslkeylog-0.5.3.tar.gz (5.6 MB view details)

Uploaded Source

File details

Details for the file sslkeylog-0.5.3.tar.gz.

File metadata

  • Download URL: sslkeylog-0.5.3.tar.gz
  • Upload date:
  • Size: 5.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for sslkeylog-0.5.3.tar.gz
Algorithm Hash digest
SHA256 3a9e52534f56ebeadff0e9ad7e2dfa39d946869e680d71f5aab48accd9d72712
MD5 8b41a7b647e81fb3a450516f8a447933
BLAKE2b-256 a47bd5846e7c38e07342c83be5ac7e5cd574ba6a2e461f53830b407a254456b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for sslkeylog-0.5.3.tar.gz:

Publisher: publish.yml on segevfiner/sslkeylog

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.5.3 This release

1 file

0.5.2

1 file

0.5.1

1 file

0.5.0

1 file

0.4.0

1 file

0.3.0

1 file

0.2.0

1 file

0.1.1

1 file

0.1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page