AtlatestRenderedmarkdown
Readme
sigil-tls
TLS/SSL client connections for Sigil.
Secure TCP connections using mbedTLS. Supports TLS 1.2 client connections with system CA certificate verification, non-blocking I/O, and STARTTLS upgrades of existing sockets.
Modules
| Module | Purpose |
|---|---|
(sigil tls) | TLS 1.2 client connections |
API summary
| Procedure | Purpose |
|---|---|
tls-connect | Open a TLS connection to a host/port |
tls-upgrade | Upgrade an existing TCP socket to TLS (STARTTLS) |
tls-read | Read a string from a TLS connection |
tls-read-bytevector | Read raw bytes from a TLS connection |
tls-write | Write a string or bytevector to a TLS connection |
tls-close | Close a TLS connection |
tls-closed? | Whether a connection is closed |
tls-connection? | Whether a value is a TLS connection |
tls-set-non-blocking! | Toggle non-blocking mode on the underlying socket |
System prerequisites
None beyond a working C toolchain. mbedTLS is consumed transitively via sigil-crypto, which vendors mbedTLS and exposes its headers to downstream consumers automatically.
Dependencies
- sigil-stdlib
- sigil-crypto (vendors mbedTLS)
Build
sigil deps install
sigil build
sigil test --reportUsage
(import (sigil tls))
(let ((conn (tls-connect "example.com" 443)))
(tls-write conn "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n")
(display (tls-read conn))
(tls-close conn))Set SIGIL_TLS_INSECURE=1 to skip certificate verification (testing only).
License
BSD-3-Clause. See sigil-crypto for the vendored mbedTLS license terms.