rust-openssl

Safe, idiomatic Rust bindings to OpenSSL

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

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
87/100Excellent
Development Activity84
Maintenance84
Community80
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
75/100Good
Architecture87
Code Quality88
Innovation65
Learning Curve60

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 8 apps in this directory

Dart
74%
AGPL 3.0

AppFlowy

Productivity · Project Management · Collaboration

75,729

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
66
Dependency
Built with
Dart74%
Rust24%
Updated 1 weeks ago
TypeScript
67%
MIT

Hoppscotch

Developer Tools

80,055

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
66
Dependency
Built with
TypeScript67%
Vue23%
Updated 3 days ago
Rust
43%
BSD 3

MicroBin

File Storage

4,525

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
Rust43%
HTML28%
JavaScript20%
Updated 2 months ago
Rust
87%
AGPL 3.0

ParadeDB

Search · Databases · Analytics

9,175

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
88
Repo Health
87
Technical
71
Dependency
Built with
Rust87%
PLpgSQL12%
Updated today
Rust
49%
MIT

Svix

Developer Tools · Automation

3,359

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
91
Repo Health
77
Technical
70
Dependency
Built with
Rust49%
C#15%
Updated today
Rust
93%
Other

Tabby

AI Code Assistants

33,828

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

View details
61
Repo Health
78
Technical
63
Dependency
Built with
Rust93%
Updated 1 months ago
Rust
71%
MIT

Trieve

AI Development · Search · Developer Tools

2,715

All-in-one self-hostable platform for hybrid search, RAG, recommendations, and analytics built on Rust and Qdrant.

View details
43
Repo Health
74
Technical
66
Dependency
Built with
Rust71%
Updated 6 months ago
Rust
83%
AGPL 3.0

Vaultwarden

Password Manager · Security

65,652

Unofficial Bitwarden-compatible server in Rust — run the full Bitwarden ecosystem on a Raspberry Pi using every official client you already have, without the multi-container overhead.

View details
83
Repo Health
69
Technical
80
Dependency
Built with
Rust83%
Updated 6 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

Search