From 8f09a05807b3975030a410f94982c41d32def4d8 Mon Sep 17 00:00:00 2001 From: Hantong Chen Date: Wed, 27 Aug 2025 10:08:25 +0800 Subject: [PATCH 1/7] chore: optimize Cargo workspace --- Cargo.toml | 8 ++++++++ ktls-sys/Cargo.toml | 13 ++++++------- ktls/Cargo.toml | 13 ++++++------- 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a2572f3..3ce492d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,11 @@ [workspace] members = ["ktls", "ktls-sys"] resolver = "2" + +[workspace.package] +edition = "2021" +rust-version = "1.75.0" +authors = ["Amos Wenger "] +license = "MIT OR Apache-2.0" +readme = "README.md" +repository = "https://github.com/rustls/ktls" diff --git a/ktls-sys/Cargo.toml b/ktls-sys/Cargo.toml index b94ea41..02f36d9 100644 --- a/ktls-sys/Cargo.toml +++ b/ktls-sys/Cargo.toml @@ -1,15 +1,14 @@ [package] name = "ktls-sys" version = "1.0.2" -edition = "2021" -license = "MIT OR Apache-2.0" -repository = "https://github.com/rustls/ktls-sys" -documentation = "https://docs.rs/ktls-sys" -authors = ["Amos Wenger "] -readme = "README.md" +edition.workspace = true +rust-version.workspace = true +authors.workspace = true description = """ FFI bindings for `linux/tls.h` """ -rust-version = "1.75" +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] diff --git a/ktls/Cargo.toml b/ktls/Cargo.toml index d0656fa..193511d 100644 --- a/ktls/Cargo.toml +++ b/ktls/Cargo.toml @@ -1,16 +1,15 @@ [package] name = "ktls" version = "6.0.2" -edition = "2021" -license = "MIT OR Apache-2.0" -repository = "https://github.com/rustls/ktls" -documentation = "https://docs.rs/ktls" -authors = ["Amos Wenger "] -readme = "README.md" +edition.workspace = true +rust-version.workspace = true +authors.workspace = true description = """ Configures kTLS for tokio-rustls client and server connections. """ -rust-version = "1.75" +license.workspace = true +readme.workspace = true +repository.workspace = true [dependencies] libc = { version = "0.2.155", features = ["const-extern-fn"] } From a7cd9a951eba030b954108a5033356321d8ed111 Mon Sep 17 00:00:00 2001 From: Hantong Chen Date: Wed, 3 Sep 2025 14:57:03 +0800 Subject: [PATCH 2/7] chore(Cargo.toml): sort dependencies --- ktls/Cargo.toml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/ktls/Cargo.toml b/ktls/Cargo.toml index 193511d..73217ca 100644 --- a/ktls/Cargo.toml +++ b/ktls/Cargo.toml @@ -12,19 +12,19 @@ readme.workspace = true repository.workspace = true [dependencies] +futures-util = "0.3.30" +ktls-sys = "1.0.1" libc = { version = "0.2.155", features = ["const-extern-fn"] } -thiserror = "2" -tracing = "0.1.40" -tokio-rustls = { default-features = false, version = "0.26.0" } -rustls = { version = "0.23.12", default-features = false } -smallvec = "1.13.2" memoffset = "0.9.1" +nix = { version = "0.29.0", features = ["socket", "uio", "net"] } +num_enum = "0.7.3" pin-project-lite = "0.2.14" +rustls = { version = "0.23.12", default-features = false } +smallvec = "1.13.2" +thiserror = "2" tokio = { version = "1.39.2", features = ["net", "macros", "io-util"] } -ktls-sys = "1.0.1" -num_enum = "0.7.3" -futures-util = "0.3.30" -nix = { version = "0.29.0", features = ["socket", "uio", "net"] } +tokio-rustls = { default-features = false, version = "0.26.0" } +tracing = "0.1.40" [dev-dependencies] lazy_static = "1.5.0" From 88dff5d63ea60e452ee515fd1471787d615a70b4 Mon Sep 17 00:00:00 2001 From: Hantong Chen Date: Wed, 3 Sep 2025 16:24:05 +0800 Subject: [PATCH 3/7] docs(README): update license badge desc according to SPDX 2.1 --- README.md | 2 +- ktls-sys/README.md | 2 +- ktls/README.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index f56866d..2b667f3 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ [![test pipeline](https://github.com/hapsoc/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/hapsoc/ktls/actions/workflows/test.yml?query=branch%3Amain) [![Coverage Status (codecov.io)](https://codecov.io/gh/hapsoc/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/hapsoc/ktls/) -[![license: MIT/Apache-2.0](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE-MIT) +[![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) # ktls diff --git a/ktls-sys/README.md b/ktls-sys/README.md index 2cee2cd..239cc4a 100644 --- a/ktls-sys/README.md +++ b/ktls-sys/README.md @@ -1,7 +1,7 @@ [![test pipeline](https://github.com/hapsoc/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/hapsoc/ktls/actions/workflows/test.yml?query=branch%3Amain) [![Coverage Status (codecov.io)](https://codecov.io/gh/hapsoc/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/hapsoc/ktls/) [![Crates.io](https://img.shields.io/crates/v/ktls-sys)](https://crates.io/crates/ktls-sys) -[![license: MIT/Apache-2.0](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE-MIT) +[![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) # ktls-sys diff --git a/ktls/README.md b/ktls/README.md index 59c8897..4f4aac7 100644 --- a/ktls/README.md +++ b/ktls/README.md @@ -1,7 +1,7 @@ [![test pipeline](https://github.com/hapsoc/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/hapsoc/ktls/actions/workflows/test.yml?query=branch%3Amain) [![Coverage Status (codecov.io)](https://codecov.io/gh/hapsoc/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/hapsoc/ktls/) [![Crates.io](https://img.shields.io/crates/v/ktls)](https://crates.io/crates/ktls) -[![license: MIT/Apache-2.0](https://img.shields.io/badge/license-MIT%2FApache--2.0-blue.svg)](LICENSE-MIT) +[![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) # ktls From 3ae7690c2468a2938f8e4af281ebcaac69c123d7 Mon Sep 17 00:00:00 2001 From: Hantong Chen Date: Wed, 3 Sep 2025 16:25:39 +0800 Subject: [PATCH 4/7] docs(README): fix broken URLs of badges --- README.md | 4 ++-- ktls-sys/README.md | 6 +++--- ktls/README.md | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 2b667f3..4426dd2 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![test pipeline](https://github.com/hapsoc/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/hapsoc/ktls/actions/workflows/test.yml?query=branch%3Amain) -[![Coverage Status (codecov.io)](https://codecov.io/gh/hapsoc/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/hapsoc/ktls/) +[![Test pipeline](https://github.com/rustls/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/rustls/ktls/actions/workflows/test.yml?query=branch%3Amain) +[![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/ktls/) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) # ktls diff --git a/ktls-sys/README.md b/ktls-sys/README.md index 239cc4a..f37659b 100644 --- a/ktls-sys/README.md +++ b/ktls-sys/README.md @@ -1,5 +1,5 @@ -[![test pipeline](https://github.com/hapsoc/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/hapsoc/ktls/actions/workflows/test.yml?query=branch%3Amain) -[![Coverage Status (codecov.io)](https://codecov.io/gh/hapsoc/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/hapsoc/ktls/) +[![Test pipeline](https://github.com/rustls/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/rustls/ktls/actions/workflows/test.yml?query=branch%3Amain) +[![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/ktls/) [![Crates.io](https://img.shields.io/crates/v/ktls-sys)](https://crates.io/crates/ktls-sys) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) @@ -9,7 +9,7 @@ Generated with `bindgen tls.h -o src/bindings.rs` -See for a higher-level / safer interface. +See for a higher-level / safer interface. ## License diff --git a/ktls/README.md b/ktls/README.md index 4f4aac7..1751554 100644 --- a/ktls/README.md +++ b/ktls/README.md @@ -1,5 +1,5 @@ -[![test pipeline](https://github.com/hapsoc/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/hapsoc/ktls/actions/workflows/test.yml?query=branch%3Amain) -[![Coverage Status (codecov.io)](https://codecov.io/gh/hapsoc/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/hapsoc/ktls/) +[![Test pipeline](https://github.com/rustls/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/rustls/ktls/actions/workflows/test.yml?query=branch%3Amain) +[![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/ktls/) [![Crates.io](https://img.shields.io/crates/v/ktls)](https://crates.io/crates/ktls) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) From 57fc390e85f347f510c87f75b293716f78293429 Mon Sep 17 00:00:00 2001 From: Hantong Chen Date: Wed, 3 Sep 2025 16:28:13 +0800 Subject: [PATCH 5/7] docs(README): adjust badge order (make crates.io first) --- ktls-sys/README.md | 2 +- ktls/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ktls-sys/README.md b/ktls-sys/README.md index f37659b..4a9f8c5 100644 --- a/ktls-sys/README.md +++ b/ktls-sys/README.md @@ -1,6 +1,6 @@ +[![Crates.io](https://img.shields.io/crates/v/ktls-sys)](https://crates.io/crates/ktls-sys) [![Test pipeline](https://github.com/rustls/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/rustls/ktls/actions/workflows/test.yml?query=branch%3Amain) [![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/ktls/) -[![Crates.io](https://img.shields.io/crates/v/ktls-sys)](https://crates.io/crates/ktls-sys) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) # ktls-sys diff --git a/ktls/README.md b/ktls/README.md index 1751554..9362d47 100644 --- a/ktls/README.md +++ b/ktls/README.md @@ -1,6 +1,6 @@ +[![Crates.io](https://img.shields.io/crates/v/ktls)](https://crates.io/crates/ktls) [![Test pipeline](https://github.com/rustls/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/rustls/ktls/actions/workflows/test.yml?query=branch%3Amain) [![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/ktls/) -[![Crates.io](https://img.shields.io/crates/v/ktls)](https://crates.io/crates/ktls) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) # ktls From 524e922f4567f8a0b86fa6607afcd59a0fa1ac68 Mon Sep 17 00:00:00 2001 From: Hantong Chen Date: Wed, 3 Sep 2025 16:28:50 +0800 Subject: [PATCH 6/7] docs(README): add docs.rs badge --- ktls-sys/README.md | 1 + ktls/README.md | 1 + 2 files changed, 2 insertions(+) diff --git a/ktls-sys/README.md b/ktls-sys/README.md index 4a9f8c5..2ad47b1 100644 --- a/ktls-sys/README.md +++ b/ktls-sys/README.md @@ -1,4 +1,5 @@ [![Crates.io](https://img.shields.io/crates/v/ktls-sys)](https://crates.io/crates/ktls-sys) +[![Docs.rs](https://docs.rs/ktls-sys/badge.svg)](https://docs.rs/ktls-sys) [![Test pipeline](https://github.com/rustls/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/rustls/ktls/actions/workflows/test.yml?query=branch%3Amain) [![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/ktls/) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) diff --git a/ktls/README.md b/ktls/README.md index 9362d47..d779a13 100644 --- a/ktls/README.md +++ b/ktls/README.md @@ -1,4 +1,5 @@ [![Crates.io](https://img.shields.io/crates/v/ktls)](https://crates.io/crates/ktls) +[![Docs.rs](https://docs.rs/ktls/badge.svg)](https://docs.rs/ktls) [![Test pipeline](https://github.com/rustls/ktls/actions/workflows/test.yml/badge.svg)](https://github.com/rustls/ktls/actions/workflows/test.yml?query=branch%3Amain) [![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/ktls/) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) From 7d9d5cc7ab563780adcc1d8a5446f16930d84bfd Mon Sep 17 00:00:00 2001 From: Hantong Chen Date: Wed, 3 Sep 2025 16:32:31 +0800 Subject: [PATCH 7/7] docs(README): optimize desc of crate --- README.md | 4 ++-- ktls/README.md | 9 +++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 4426dd2..9280c1a 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,8 @@ This repository hosts both: - * [ktls](./ktls): higher-level, safe wrappers over kTLS - * [ktls-sys](./ktls-sys): the raw system interface for kTLS on Linux + * [ktls](./ktls): high-level APIs for configuring kTLS (kernel TLS offload) on top of [rustls]. + * [ktls-sys](./ktls-sys): the raw system interface for kTLS on Linux (deprecated). ## License diff --git a/ktls/README.md b/ktls/README.md index d779a13..aab7ffc 100644 --- a/ktls/README.md +++ b/ktls/README.md @@ -4,11 +4,9 @@ [![Coverage Status (codecov.io)](https://codecov.io/gh/rustls/ktls/branch/main/graph/badge.svg)](https://codecov.io/gh/rustls/ktls/) [![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](LICENSE-MIT) -# ktls +# ktls - Kernel TLS offload (kTLS) support built on top of [rustls]. -Configures kTLS ([kernel TLS -offload](https://www.kernel.org/doc/html/latest/networking/tls-offload.html)) -for any type that implements `AsRawFd`, given a rustls `ServerConnection`. +This crate provides high-level APIs for configuring [kernel TLS offload] (kTLS). ## License @@ -16,3 +14,6 @@ This project is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and [LICENSE-MIT](LICENSE-MIT) for details. + +[kernel TLS offload]: https://www.kernel.org/doc/html/latest/networking/tls-offload.html +[rustls]: https://docs.rs/rustls/latest/rustls/kernel/index.html