pyOpenSSL

A Python wrapper around the OpenSSL library for TLS connections and certificate handling

Library
PyPI
v26.4.0
944stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
74/100Good
Development Activity80
Maintenance40
Community88
Maturity60
Momentum28

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
74/100Good
Architecture78
Code Quality82
Innovation65
Learning Curve70

pyOpenSSL is a thin, Pythonic wrapper around a subset of the OpenSSL C library, maintained by the Python Cryptographic Authority (PyCA). It exposes SSL.Connection objects that wrap Python’s portable socket API, extensive error-handling that mirrors OpenSSL’s native error codes, and Python-level callbacks for verification and session handling.

The project predates the modern cryptography library and today serves mainly as a compatibility layer: PyCA explicitly recommends new code use cryptography directly and only reach for pyOpenSSL when a dependency (commonly Twisted, or legacy TLS-heavy codebases) requires its specific SSL.Connection interface.

What You Get

  • SSL.Context and SSL.Connection classes that wrap OpenSSL’s TLS state machine around Python sockets
  • X.509 certificate, certificate-request, and CRL parsing and generation via the crypto module
  • Python-level callbacks for certificate verification, SNI, ALPN/NPN negotiation, and session tickets
  • Detailed exception hierarchy (SSL.Error, crypto.Error) that mirrors OpenSSL’s native error codes
  • PKCS#12 and PKCS#7 container support for loading bundled keys/certs

Common Use Cases

  • Powering Twisted’s TLS transport, which depends directly on pyOpenSSL’s SSL.Connection API
  • Legacy codebases that need fine-grained control over TLS handshake callbacks not exposed by the stdlib ssl module
  • Generating and inspecting X.509 certificates and CRLs in internal PKI tooling
  • Parsing PKCS#12 (.p12/.pfx) bundles for certificate/key extraction

Under The Hood

Architecture - pyOpenSSL is organized as two flat modules under src/OpenSSL/: SSL.py (3,361 lines) implements Context and Connection, wrapping OpenSSL’s TLS state machine around Python’s socket objects and dispatching handshake/verification events to user-supplied Python callbacks; crypto.py (1,950 lines) implements X.509 certificate, certificate-request, CRL, and PKCS#12/PKCS#7 parsing and generation. Both modules call into cryptography’s CFFI bindings to OpenSSL rather than binding libssl directly, so pyOpenSSL is effectively a higher-level, backward-compatible facade over cryptography’s lower-level primitives. Tech Stack - The only runtime dependency is cryptography itself (which supplies the CFFI/OpenSSL bindings); the package is pure Python with no C extension of its own, built via a standard setup.py/pyproject.toml combo and tested across CPython and PyPy. Code Quality - The tests/ directory mirrors the source layout (test_ssl.py, test_crypto.py, test_rand.py, test_util.py) with pytest and strict-markers enabled, plus ruff linting and mypy --strict type checking configured in pyproject.toml, indicating a mature, well-guarded test and type-safety setup for a 900+ star, decade-old project. API Design - The API mirrors OpenSSL’s own C API naming closely (Context, Connection, X509, X509Req) which gives experienced OpenSSL/TLS users a familiar surface but means newcomers face OpenSSL’s own conceptual complexity; the README is explicit that new projects should prefer cryptography directly, positioning pyOpenSSL as a compatibility/legacy layer rather than a beginner-friendly entry point.

Used by 6 apps in this directory

Python
73%
MIT

CertMate

Security · Devops

1,382

Automate SSL certificate lifecycle across any CA, 24+ DNS providers, and every major secret store — with a REST API, web dashboard, and built-in MCP server for AI-driven ops.

View details
82
Repo Health
84
Technical
70
Dependency
Built with
Python73%
JavaScript12%
HTML12%
Updated yesterday
C++
66%
Other

Memgraph

Databases · AI Development

4,347

High-performance in-memory graph database for AI context and real-time analytics

View details
90
Repo Health
79
Technical
70
Dependency
Built with
C++66%
Python18%
Updated today
Python
52%
Other

Odoo

ERP · CRM · Productivity

53,793

The open source ERP platform that integrates CRM, accounting, inventory, manufacturing, and 60+ business apps into one seamlessly connected suite.

View details
87
Repo Health
82
Technical
64
Dependency
Built with
Python52%
JavaScript44%
Updated today
Go
56%
Apache 2.0

OSV.dev

Security

2,888

Google's open-source vulnerability database that maps CVEs to exact package versions across 50+ ecosystems with a public API and data dumps.

View details
90
Repo Health
82
Technical
70
Dependency
Built with
Go56%
Python32%
Updated today
Python
45%
Other

Redash

Analytics · Data Engineering

28,754

Redash lets anyone connect to 35+ SQL and NoSQL data sources, write a query in the browser, and turn the result into a shared dashboard — no separate BI suite required.

View details
85
Repo Health
74
Technical
61
Dependency
Built with
Python45%
JavaScript31%
TypeScript17%
Updated yesterday
Python
61%
Apache 2.0

WrenAI

Analytics · AI Agents · Data Engineering

17,313

Open-source GenBI engine that lets AI agents turn natural-language questions into governed SQL, charts, and shareable dashboards across 20+ data sources — no vendor lock-in, no black-box prompts.

View details
91
Repo Health
91
Technical
69
Dependency
Built with
Python61%
Rust36%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search