https://github.com/crazyguitar/ktls-example
ktls related example
https://github.com/crazyguitar/ktls-example
ktls linux tls
Last synced: 10 months ago
JSON representation
ktls related example
- Host: GitHub
- URL: https://github.com/crazyguitar/ktls-example
- Owner: crazyguitar
- License: mit
- Created: 2017-11-25T10:12:28.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-12-18T05:01:41.000Z (over 8 years ago)
- Last Synced: 2025-07-10T16:40:38.721Z (12 months ago)
- Topics: ktls, linux, tls
- Language: C
- Size: 41 KB
- Stars: 5
- Watchers: 2
- Forks: 5
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# KTLS example
[](https://travis-ci.org/crazyguitar/ktls-example)
## Prerequisite
* linux 4.13 or above
* openssl 1.0.x
## Generate self-signed certificate
```bash
$ openssl ecparam -out key.pem -genkey -name prime256v1
$ openssl req -x509 -new -key key.pem -out cert.pem
```
## Run the binaries
```bash
$ make
$ dd if=/dev/zero of=.dd.test bs=1M count=512
$ ./ktls_sendfile 127.0.0.1 .dd.test
start do_sendfile(.dd.test)
sendfile cost time: 2.27
end do_sendfile(.dd.test)
checksum(.TMP_ktls): aa559b4e3523a6c931f08f4df52d58f2
checksum(.dd.test): aa559b4e3523a6c931f08f4df52d58f2
```
## Reference
* [djwatson/ktls](https://github.com/djwatson/ktls)
* [ktls/afi\_ktls-tool](https://github.com/ktls/af_ktls-tool)
* [include/uapi/linux/tls.h](https://github.com/torvalds/linux/blob/master/include/uapi/linux/tls.h)
* [linux/Documentation/networking/tls.txt](https://github.com/torvalds/linux/blob/master/Documentation/networking/tls.txt)
* [TLS: Linux Kernel Transport Layer Security - NetDev](https://netdevconf.org/1.2/papers/ktls.pdf)
* [Playing with kernel TLS in Linux 4.13 and Go - Filippo.io](https://blog.filippo.io/playing-with-kernel-tls-in-linux-4-13-and-go/)