mini-tls
Description
mini-tls is a self-contained mini TLS server and TLS client project in pure C/CPP built on the crypery library (TLS 1.2/1.3). There are no external dependencies: all crypto algorithms are implemented from scratch inside the crypery library.
The server listens on a TCP port, generates an RSA-2048 key and a self-signed X.509 certificate at startup, performs a TLS handshake with each connecting client (auto-selecting TLS 1.2 or 1.3) and echoes back all received data. The client connects to the server, performs the handshake, prints the negotiated session parameters and exchanges messages with the server in interactive or non-interactive mode.
Modules used
The examples use the tls module directly; all library modules are compiled at build time:
- tls - base crypto layer: TLS 1.2/1.3 handshake (client/server), AES-128-GCM, SHA-256, HMAC-SHA256, RSA-2048, ECDH (P-256, X25519), X.509 certificate generation and parsing
- ssl - OpenSSL-compatible wrapper over the built-in TLS (SSL_CTX/SSL API, timeouts, peer certificate verification)
- http - HTTP/1.1 server over TCP/TLS (routing, static files, WebSocket, SSE)
- url - HTTP/HTTPS client (curl-like API, redirects, chunked encoding)
Technologies
- C/CPP, crypery library (TLS 1.2/1.3)
- Cryptography: AES-128-GCM, SHA-256, HMAC-SHA256, HKDF, RSA-2048, ECDH (P-256, X25519), X.509
- Windows (MinGW, Winsock) and Unix-like systems (BSD sockets)
- License GNU AGPL v3 (Affero GPL)