rust-openssl

Safe, idiomatic Rust bindings to OpenSSL

Library
Cargo
v0.10.81
1,650 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
84 /100 Excellent
Development Activity 76
Maintenance 80
Community 80
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
75 /100 Good
Architecture 87
Code Quality 88
Innovation 65
Learning Curve 60

rust-openssl provides idiomatic, memory-safe Rust bindings to the OpenSSL cryptography library, covering TLS/SSL client and server connections, X.509 certificate parsing and generation, symmetric and asymmetric encryption, digital signatures, message digests/HMAC, and PKCS#7/CMS/PKCS#12 handling. The high-level openssl crate wraps the raw FFI declarations exposed by the lower-level openssl-sys crate, converting OpenSSL’s C API into safe Rust types with RAII-managed lifetimes, Result-based error handling, and Rust-native traits.

The workspace also includes openssl-macros (internal proc-macros for generating boilerplate wrapper types) and openssl-errors (structured error-code definitions). It supports building against a system-installed OpenSSL, a vendored/statically-built OpenSSL via the vendored feature, or alternative implementations like BoringSSL and AWS-LC through feature flags, making it the most widely used cryptography/TLS binding in the Rust ecosystem — it underlies major HTTP clients and servers that need OpenSSL-compatible TLS rather than a pure-Rust TLS stack.

What You Get

  • Safe wrappers for TLS/SSL client and server connections (SslConnector, SslAcceptor) built directly on OpenSSL’s SSL_CTX/SSL types
  • X.509 certificate parsing, generation, and verification, including certificate signing requests and extensions
  • Symmetric ciphers (AES, ChaCha20, etc.), asymmetric crypto (RSA, EC, Ed25519/X25519), message digests, and HMAC via a unified Cipher/MessageDigest API
  • PKCS#7/CMS and PKCS#12 support for signing, enveloping, and certificate-bundle handling
  • A vendored feature to statically build and link OpenSSL from source instead of depending on the system library, plus alternative-backend features for BoringSSL and AWS-LC
  • The lower-level openssl-sys crate for anyone who needs raw FFI access beyond the safe high-level API

Common Use Cases

  • Adding TLS support to a Rust HTTP client or server that needs OpenSSL-compatible behavior (cipher suite parity, corporate CA trust stores) rather than a pure-Rust TLS stack like rustls
  • Parsing, validating, or generating X.509 certificates as part of a PKI or certificate-management tool
  • Implementing application-level encryption or signing (message digests, HMAC, RSA/EC signatures) using OpenSSL’s audited cryptographic primitives
  • Statically bundling OpenSSL into a deployed binary via the vendored feature to avoid depending on the target system’s OpenSSL version

Under The Hood

Architecture - The workspace layers three main crates: openssl-sys declares raw unsafe extern "C" FFI bindings generated against OpenSSL’s C headers (with bindgen support for regenerating them); openssl wraps every FFI type in a safe Rust struct using RAII (Drop implementations call the matching _free function) and converts C-style error codes into Result<T, ErrorStack>; and openssl-macros supplies proc-macros that generate the repetitive foreign_type!-style boilerplate needed to wrap each OpenSSL opaque pointer type consistently. openssl-errors centralizes structured error-code-to-message mappings. systest is a workspace-internal crate that fuzzes the FFI layer against the real OpenSSL headers to catch signature drift. Tech Stack - Pure Rust (edition 2021, MSRV 1.80.0) with feature flags controlling the crypto backend: default builds link a system OpenSSL, vendored statically compiles OpenSSL from source via the openssl-src build dependency, and separate features swap in BoringSSL or AWS-LC (including AWS-LC’s FIPS-validated build) as drop-in alternatives to upstream OpenSSL. Code Quality - The openssl crate alone spans ~36,700 lines of Rust, reflecting the breadth of OpenSSL’s API surface it wraps; clippy.toml enforces linting workspace-wide, and the systest crate exists specifically to catch FFI signature mismatches between openssl-sys’s hand-maintained bindings and the actual OpenSSL headers — an unusual, deliberate quality safeguard for a crate whose correctness has direct security implications. API Design - Common operations like establishing a TLS connection or hashing data require only a few calls (SslConnector::builder(), MessageDigest::sha256()), with Rust idioms (builders, Result, RAII) replacing OpenSSL’s verbose C initialization/cleanup patterns; the trade-off is that some very low-level or version-specific OpenSSL behavior still requires dropping down to openssl-sys directly.

Used by 12 apps in this directory

Dart
74%
AGPL 3.0

AppFlowy

AI Assistants · Collaboration · Productivity

76,967

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
67
Dependency
Built with
Dart 74%
Rust 24%
Updated 1 weeks ago
Dart
74%
AGPL 3.0

AppFlowy

AI Assistants · Collaboration · Productivity

76,967

The open-source AI workspace that puts your data, your rules — with local LLMs, CRDT collaboration, and full self-hosting built in.

View details
66
Repo Health
81
Technical
67
Dependency
Built with
Dart 74%
Rust 24%
Updated 1 weeks ago
TypeScript
67%
MIT

Hoppscotch

Developer Tools

80,529

A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.

View details
91
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 67%
Vue 25%
Updated 6 days ago
TypeScript
67%
MIT

Hoppscotch

Developer Tools

80,529

A lightweight, offline-capable API development ecosystem for testing HTTP, GraphQL, WebSocket, MQTT, and SSE endpoints across web, desktop, and CLI.

View details
91
Repo Health
83
Technical
65
Dependency
Built with
TypeScript 67%
Vue 25%
Updated 6 days ago
Rust
43%
BSD 3

MicroBin

File Storage

4,571

A self-contained, encrypted paste bin and file-sharing app in Rust with animal-name URLs, burn-after-read, and one-command Docker deployment.

View details
56
Repo Health
67
Technical
71
Dependency
Built with
Rust 43%
HTML 28%
JavaScript 20%
Updated 3 weeks ago
Rust
86%
AGPL 3.0

ParadeDB

Analytics · Databases · Search

9,311

Born out of Y Combinator's S2023 batch, ParadeDB is a Postgres extension that delivers Elasticsearch-quality BM25 search and real-time analytics without a separate search cluster to manage.

View details
89
Repo Health
87
Technical
68
Dependency
Built with
Rust 86%
PLpgSQL 14%
Updated 4 days ago
Rust
47%
MIT

Svix

Automation · Developer Tools

3,423

Open source, self-hostable webhook infrastructure that handles delivery, retries, HMAC signing, and multi-tenant event management so you never have to build a webhooks system from scratch.

View details
90
Repo Health
77
Technical
67
Dependency
Built with
Rust 47%
C# 15%
Updated 1 weeks ago
Rust
93%
Other

Tabby

AI Code Assistants

33,892

Self-hosted AI coding assistant — run GitHub Copilot-grade code completion on your own hardware with no cloud dependency.

View details
58
Repo Health
78
Technical
61
Dependency
Built with
Rust 93%
Updated 3 months ago
TypeScript
67%
Apache 2.0

tabularis

Databases · Developer Tools

5,076

Open-source desktop SQL workspace with built-in PostgreSQL, MySQL, and SQLite drivers, SQL notebooks, a visual query builder, and a built-in MCP server for AI agents like Claude and Cursor.

View details
83
Repo Health
89
Technical
70
Dependency
Built with
TypeScript 67%
Rust 32%
Updated 5 days ago

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