{"id":28562678,"url":"https://github.com/rustls/tokio-rustls","last_synced_at":"2025-06-10T12:11:00.999Z","repository":{"id":171233294,"uuid":"647616362","full_name":"rustls/tokio-rustls","owner":"rustls","description":"Async TLS for the Tokio runtime","archived":false,"fork":false,"pushed_at":"2025-06-06T13:54:51.000Z","size":425,"stargazers_count":150,"open_issues_count":15,"forks_count":81,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-06-08T00:08:38.032Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rustls.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-05-31T06:57:12.000Z","updated_at":"2025-06-07T09:07:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"febb2f48-8f41-43dd-b5fa-6bc098a44b89","html_url":"https://github.com/rustls/tokio-rustls","commit_stats":{"total_commits":309,"total_committers":56,"mean_commits":5.517857142857143,"dds":"0.49514563106796117","last_synced_commit":"409d8742efd3f2b2976623edfe80e0b5dc57769f"},"previous_names":["rustls/tokio-rustls"],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Ftokio-rustls","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Ftokio-rustls/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Ftokio-rustls/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Ftokio-rustls/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rustls","download_url":"https://codeload.github.com/rustls/tokio-rustls/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rustls%2Ftokio-rustls/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259072991,"owners_count":22801090,"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":[],"created_at":"2025-06-10T12:11:00.397Z","updated_at":"2025-06-10T12:11:00.987Z","avatar_url":"https://github.com/rustls.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tokio-rustls\n\n[![github actions](https://github.com/rustls/tokio-rustls/workflows/CI/badge.svg)](https://github.com/rustls/tokio-rustls/actions)\n[![crates](https://img.shields.io/crates/v/tokio-rustls.svg)](https://crates.io/crates/tokio-rustls)\n[![license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/rustls/tokio-rustls/blob/main/LICENSE-MIT)\n[![license](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/rustls/tokio-rustls/blob/main/LICENSE-APACHE)\n[![docs.rs](https://docs.rs/tokio-rustls/badge.svg)](https://docs.rs/tokio-rustls)\n\nAsynchronous TLS/SSL streams for [Tokio](https://tokio.rs/) using\n[Rustls](https://github.com/rustls/rustls).\n\n### Basic Structure of a Client\n\n```rust\nuse rustls_pki_types::ServerName;\nuse std::sync::Arc;\nuse tokio::net::TcpStream;\nuse tokio_rustls::rustls::{ClientConfig, RootCertStore};\nuse tokio_rustls::TlsConnector;\n\n// ...\n\nlet mut root_cert_store = RootCertStore::empty();\nroot_cert_store.extend(webpki_roots::TLS_SERVER_ROOTS.iter().cloned());\nlet config = ClientConfig::builder()\n    .with_root_certificates(root_cert_store)\n    .with_no_client_auth();\nlet connector = TlsConnector::from(Arc::new(config));\nlet dnsname = ServerName::try_from(\"www.rust-lang.org\").unwrap();\n\nlet stream = TcpStream::connect(\u0026addr).await?;\nlet mut stream = connector.connect(dnsname, stream).await?;\n\n// ...\n```\n\n### Client Example Program\n\nSee [examples/client.rs](examples/client.rs). You can run it with:\n\n```sh\ncargo run --example client -- hsts.badssl.com\n```\n\n### Server Example Program\n\nSee [examples/server.rs](examples/server.rs). You can run it with:\n\n```sh\ncargo run --example server -- 127.0.0.1:8000 --cert certs/cert.pem --key certs/cert.key.pem\n```\n\nIf you don't have a certificate and key, you can generate a random key and\nself-signed certificate for testing with:\n\n```sh\ncargo install --locked rustls-cert-gen\nrustls-cert-gen --output certs/ --san localhost\n```\n\n### License \u0026 Origin\n\nThis project is licensed under either of\n\n- Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or\n  https://www.apache.org/licenses/LICENSE-2.0)\n- MIT license ([LICENSE-MIT](LICENSE-MIT) or\n  https://opensource.org/licenses/MIT)\n\nat your option.\n\nThis started as a fork of [tokio-tls](https://github.com/tokio-rs/tokio-tls).\n\n### Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in tokio-rustls by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustls%2Ftokio-rustls","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frustls%2Ftokio-rustls","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frustls%2Ftokio-rustls/lists"}