{"id":13438845,"url":"https://github.com/rustls/rustls","last_synced_at":"2025-05-12T16:26:49.300Z","repository":{"id":37860611,"uuid":"57920736","full_name":"rustls/rustls","owner":"rustls","description":"A modern TLS library in Rust","archived":false,"fork":false,"pushed_at":"2025-05-12T13:14:27.000Z","size":13788,"stargazers_count":6670,"open_issues_count":125,"forks_count":713,"subscribers_count":84,"default_branch":"main","last_synced_at":"2025-05-12T14:41:52.010Z","etag":null,"topics":["cryptography","rust","ssl","tls"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustls.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":"audit/TLS-01-report.pdf","citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-05-02T20:50:44.000Z","updated_at":"2025-05-12T13:14:29.000Z","dependencies_parsed_at":"2024-01-13T17:24:32.419Z","dependency_job_id":"9606f7f6-9199-470f-9a91-fd925a04c1fb","html_url":"https://github.com/rustls/rustls","commit_stats":{"total_commits":3448,"total_committers":168,"mean_commits":"20.523809523809526","dds":0.552784222737819,"last_synced_commit":"5c5cdcc60a53c5870a8f7a49a6c7433c12acc5c9"},"previous_names":["ctz/rustls"],"tags_count":94,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Frustls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Frustls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Frustls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Frustls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustls","download_url":"https://codeload.github.com/rustls/rustls/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253775352,"owners_count":21962330,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cryptography","rust","ssl","tls"],"created_at":"2024-07-31T03:01:08.931Z","updated_at":"2025-05-12T16:26:49.263Z","avatar_url":"https://github.com/rustls.png","language":"Rust","readme":"\u003cp align=\"center\"\u003e\n  \u003cimg width=\"460\" height=\"300\" src=\"https://raw.githubusercontent.com/rustls/rustls/main/admin/rustls-logo-web.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nRustls is a modern TLS library written in Rust.\n\u003c/p\u003e\n\n# Status\n\nRustls is used in production at many organizations and projects. We aim to maintain\nreasonable API surface stability but the API may evolve as we make changes to accommodate\nnew features or performance improvements.\n\nWe have a [roadmap](ROADMAP.md) for our future plans. We also have [benchmarks](BENCHMARKING.md) to\nprevent performance regressions and to let you evaluate rustls on your target hardware.\n\nIf you'd like to help out, please see [CONTRIBUTING.md](CONTRIBUTING.md).\n\n[![Build Status](https://github.com/rustls/rustls/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/rustls/rustls/actions/workflows/build.yml?query=branch%3Amain)\n[![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/rustls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/rustls/)\n[![Documentation](https://docs.rs/rustls/badge.svg)](https://docs.rs/rustls/)\n[![Chat](https://img.shields.io/discord/976380008299917365?logo=discord)](https://discord.gg/MCSB76RU96)\n[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/9034/badge)](https://www.bestpractices.dev/projects/9034)\n\n## Changelog\n\nThe detailed list of changes in each release can be found at\nhttps://github.com/rustls/rustls/releases.\n\n# Documentation\n\nhttps://docs.rs/rustls/\n\n# Approach\n\nRustls is a TLS library that aims to provide a good level of cryptographic security,\nrequires no configuration to achieve that security, and provides no unsafe features or\nobsolete cryptography by default.\n\nRustls implements TLS1.2 and TLS1.3 for both clients and servers. See [the full\nlist of protocol features](https://docs.rs/rustls/latest/rustls/manual/_04_features/index.html).\n\n### Platform support\n\nWhile Rustls itself is platform independent, by default it uses [`aws-lc-rs`] for implementing\nthe cryptography in TLS.  See [the aws-lc-rs FAQ][aws-lc-rs-platforms-faq] for more details of the\nplatform/architecture support constraints in aws-lc-rs.\n\n[`ring`] is also available via the `ring` crate feature: see\n[the supported `ring` target platforms][ring-target-platforms].\n\nBy providing a custom instance of the [`crypto::CryptoProvider`] struct, you\ncan replace all cryptography dependencies of rustls.  This is a route to being portable\nto a wider set of architectures and environments, or compliance requirements.  See the\n[`crypto::CryptoProvider`] documentation for more details.\n\nSpecifying `default-features = false` when depending on rustls will remove the implicit\ndependency on aws-lc-rs.\n\nRustls requires Rust 1.71 or later. It has an optional dependency on zlib-rs which requires 1.75 or later.\n\n[ring-target-platforms]: https://github.com/briansmith/ring/blob/2e8363b433fa3b3962c877d9ed2e9145612f3160/include/ring-core/target.h#L18-L64\n[`crypto::CryptoProvider`]: https://docs.rs/rustls/latest/rustls/crypto/struct.CryptoProvider.html\n[`ring`]: https://crates.io/crates/ring\n[aws-lc-rs-platforms-faq]: https://aws.github.io/aws-lc-rs/faq.html#can-i-run-aws-lc-rs-on-x-platform-or-architecture\n[`aws-lc-rs`]: https://crates.io/crates/aws-lc-rs\n\n### Cryptography providers\n\nSince Rustls 0.22 it has been possible to choose the provider of the cryptographic primitives\nthat Rustls uses. This may be appealing if you have specific platform, compliance or feature\nrequirements that aren't met by the default provider, [`aws-lc-rs`].\n\nUsers that wish to customize the provider in use can do so when constructing `ClientConfig`\nand `ServerConfig` instances using the `with_crypto_provider` method on the respective config\nbuilder types. See the [`crypto::CryptoProvider`] documentation for more details.\n\n#### Built-in providers\n\nRustls ships with two built-in providers controlled by associated crate features:\n\n* [`aws-lc-rs`] - enabled by default, available with the `aws_lc_rs` crate feature enabled.\n* [`ring`] - available with the `ring` crate feature enabled.\n\nSee the documentation for [`crypto::CryptoProvider`] for details on how providers are\nselected.\n\n#### Third-party providers\n\nThe community has also started developing third-party providers for Rustls:\n\n* [`rustls-mbedtls-provider`] - a provider that uses [`mbedtls`] for cryptography.\n* [`rustls-openssl`] - a provider that uses [OpenSSL] for cryptography.\n* [`boring-rustls-provider`] - a work-in-progress provider that uses [`boringssl`] for\ncryptography.\n* [`rustls-rustcrypto`] - an experimental provider that uses the crypto primitives\nfrom [`RustCrypto`] for cryptography.\n* [`rustls-symcrypt`] - a provider that uses Microsoft's [SymCrypt] library.\n* [`rustls-wolfcrypt-provider`] - a work-in-progress provider that uses [`wolfCrypt`] for cryptography.\n\n[`rustls-mbedtls-provider`]: https://github.com/fortanix/rustls-mbedtls-provider\n[`mbedtls`]: https://github.com/Mbed-TLS/mbedtls\n[`rustls-openssl`]: https://github.com/tofay/rustls-openssl\n[OpenSSL]: https://openssl-library.org/\n[`rustls-symcrypt`]: https://github.com/microsoft/rustls-symcrypt\n[SymCrypt]: https://github.com/microsoft/SymCrypt\n[`boring-rustls-provider`]: https://github.com/janrueth/boring-rustls-provider\n[`boringssl`]: https://github.com/google/boringssl\n[`rustls-rustcrypto`]: https://github.com/RustCrypto/rustls-rustcrypto\n[`RustCrypto`]: https://github.com/RustCrypto\n[`rustls-wolfcrypt-provider`]: https://github.com/wolfSSL/rustls-wolfcrypt-provider\n[`wolfCrypt`]: https://www.wolfssl.com/products/wolfcrypt\n\n#### Custom provider\n\nWe also provide a simple example of writing your own provider in the [custom provider example].\nThis example implements a minimal provider using parts of the [`RustCrypto`] ecosystem.\n\nSee the [Making a custom CryptoProvider] section of the documentation for more information\non this topic.\n\n[custom provider example]: https://github.com/rustls/rustls/tree/main/provider-example/\n[`RustCrypto`]: https://github.com/RustCrypto\n[Making a custom CryptoProvider]: https://docs.rs/rustls/latest/rustls/crypto/struct.CryptoProvider.html#making-a-custom-cryptoprovider\n\n# Example code\n\nOur [examples] directory contains demos that show how to handle I/O using the\n[`stream::Stream`] helper, as well as more complex asynchronous I/O using [`mio`].\nIf you're already using Tokio for an async runtime you may prefer to use\n[`tokio-rustls`] instead of interacting with rustls directly.\n\nThe [`mio`] based examples are the most complete, and discussed below. Users\nnew to Rustls may prefer to look at the simple client/server examples before\ndiving in to the more complex MIO examples.\n\n[examples]: examples/\n[`stream::Stream`]: https://docs.rs/rustls/latest/rustls/struct.Stream.html\n[`mio`]: https://docs.rs/mio/latest/mio/\n[`tokio-rustls`]: https://docs.rs/tokio-rustls/latest/tokio_rustls/\n\n## Client example program\n\nThe MIO client example program is named `tlsclient-mio`.\n\nSome sample runs:\n\n```\n$ cargo run --bin tlsclient-mio -- --http mozilla-modern.badssl.com\nHTTP/1.1 200 OK\nServer: nginx/1.6.2 (Ubuntu)\nDate: Wed, 01 Jun 2016 18:44:00 GMT\nContent-Type: text/html\nContent-Length: 644\n(...)\n```\n\nor\n\n```\n$ cargo run --bin tlsclient-mio -- --http expired.badssl.com\nTLS error: InvalidCertificate(Expired)\nConnection closed\n```\n\nRun `cargo run --bin tlsclient-mio -- --help` for more options.\n\n## Server example program\n\nThe MIO server example program is named `tlsserver-mio`.\n\nHere's a sample run; we start a TLS echo server, then connect to it with\n`openssl` and `tlsclient-mio`:\n\n```\n$ cargo run --bin tlsserver-mio -- --certs test-ca/rsa-2048/end.fullchain --key test-ca/rsa-2048/end.key -p 8443 echo \u0026\n$ echo hello world | openssl s_client -ign_eof -quiet -connect localhost:8443\ndepth=2 CN = ponytown RSA CA\nverify error:num=19:self signed certificate in certificate chain\nhello world\n^C\n$ echo hello world | cargo run --bin tlsclient-mio -- --cafile test-ca/rsa-2048/ca.cert --port 8443 localhost\nhello world\n^C\n```\n\nRun `cargo run --bin tlsserver-mio -- --help` for more options.\n\n# License\n\nRustls is distributed under the following three licenses:\n\n- Apache License version 2.0.\n- MIT license.\n- ISC license.\n\nThese are included as LICENSE-APACHE, LICENSE-MIT and LICENSE-ISC\nrespectively.  You may use this software under the terms of any\nof these licenses, at your option.\n\n# Project Membership\n\n- Joe Birr-Pixton ([@ctz], Project Founder - full-time funded by [Prossimo])\n- Dirkjan Ochtman ([@djc], Co-maintainer)\n- Daniel McCarney ([@cpu], Co-maintainer)\n- Josh Aas ([@bdaehlie], Project Management)\n\n[@ctz]: https://github.com/ctz\n[@djc]: https://github.com/djc\n[@cpu]: https://github.com/cpu\n[@bdaehlie]: https://github.com/bdaehlie\n[Prossimo]: https://www.memorysafety.org/initiative/rustls/\n\n# Code of conduct\n\nThis project adopts the [Rust Code of Conduct](https://www.rust-lang.org/policies/code-of-conduct).\nPlease email rustls-mod@googlegroups.com to report any instance of misconduct, or if you\nhave any comments or questions on the Code of Conduct.\n","funding_links":[],"categories":["Libraries","Rust","库 Libraries","Rust 程序设计","Useful Libraries"],"sub_categories":["Cryptography","密码学 Cryptography","网络服务_其他"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustls%2Frustls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustls%2Frustls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustls%2Frustls/lists"}