Commit8f46741eRecorded24 Apr 2026Repositorysigil-tls

Extract sigil-tls from sigil monorepo

Message

Extracted at monorepo f917ee87 (which includes the sigil-crypto extraction rewire) via git filter-repo. Preserves 18 prior commits touching packages/sigil-tls/ plus the relevant merges.

Scaffolding: - README.md: API table + build/test instructions - .gitignore: build/ + .sigil/ - manifest.scm: minimal gcc-toolchain / make / pkg-config - dev-redirects.sgl: redirects codeberg:sigil/sigil AND codeberg:sigil/sigil-crypto to local sibling checkouts

package.sgl changes: - Added version: "0.13.1" - url: swapped to codeberg:sigil/sigil-tls - sigil-stdlib: from-workspace -> from-git codeberg:sigil/sigil package: sigil-stdlib version: "^0.13.1" - sigil-crypto: already from-git, unchanged - Dropped ../sigil-lib/include and ../sigil-lib/src include-dirs from the tls.c compile step; wrapped flags: in (with-sigil-c-flags ...) so sigil-lib's include/ + src/ paths auto-inject (see topics/sigil-with-sigil-c-flags).

No functional changes to src/sigil/tls.sgl or native/tls.c.

See procedures/sigil-package-extraction for the playbook.

Changed
 .gitignore        |  2 ++
 README.md         | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 dev-redirects.sgl | 10 ++++++++++
 manifest.scm      | 11 +++++++++++
 package.sgl       | 18 +++++++++---------
 sigil.lock        | 13 +++++++++++++
 6 files changed, 108 insertions(+), 9 deletions(-)
Diff
.gitignoreadded
@@ -0,0 +1,2 @@
+1
build/
+2
.sigil/
README.mdadded
@@ -0,0 +1,63 @@
+1
# sigil-tls
+2
+3
TLS/SSL client connections for [Sigil](https://codeberg.org/sigil/sigil).
+4
+5
Secure TCP connections using mbedTLS. Supports TLS 1.2 client connections
+6
with system CA certificate verification, non-blocking I/O, and STARTTLS
+7
upgrades of existing sockets.
+8
+9
## Modules
+10
+11
| Module | Purpose |
+12
|----------------|-----------------------------------------|
+13
| `(sigil tls)` | TLS 1.2 client connections |
+14
+15
## API summary
+16
+17
| Procedure | Purpose |
+18
|---------------------------|--------------------------------------------------------|
+19
| `tls-connect` | Open a TLS connection to a host/port |
+20
| `tls-upgrade` | Upgrade an existing TCP socket to TLS (STARTTLS) |
+21
| `tls-read` | Read a string from a TLS connection |
+22
| `tls-read-bytevector` | Read raw bytes from a TLS connection |
+23
| `tls-write` | Write a string or bytevector to a TLS connection |
+24
| `tls-close` | Close a TLS connection |
+25
| `tls-closed?` | Whether a connection is closed |
+26
| `tls-connection?` | Whether a value is a TLS connection |
+27
| `tls-set-non-blocking!` | Toggle non-blocking mode on the underlying socket |
+28
+29
## System prerequisites
+30
+31
None beyond a working C toolchain. mbedTLS is consumed transitively via
+32
[sigil-crypto](https://codeberg.org/sigil/sigil-crypto), which vendors
+33
mbedTLS and exposes its headers to downstream consumers automatically.
+34
+35
## Dependencies
+36
+37
- sigil-stdlib
+38
- sigil-crypto (vendors mbedTLS)
+39
+40
## Build
+41
+42
```sh
+43
sigil deps install
+44
sigil build
+45
sigil test --report
+46
```
+47
+48
## Usage
+49
+50
```scheme
+51
(import (sigil tls))
+52
+53
(let ((conn (tls-connect "example.com" 443)))
+54
(tls-write conn "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n")
+55
(display (tls-read conn))
+56
(tls-close conn))
+57
```
+58
+59
Set `SIGIL_TLS_INSECURE=1` to skip certificate verification (testing only).
+60
+61
## License
+62
+63
BSD-3-Clause. See sigil-crypto for the vendored mbedTLS license terms.
dev-redirects.sgladded
@@ -0,0 +1,10 @@
+1
;; Development redirects — point from-git deps at local sibling checkouts
+2
;; during monorepo dev. Use: sigil build --redirects ./dev-redirects.sgl
+3
(redirects
+4
repos: (list
+5
(for-repo
+6
url: "codeberg:sigil/sigil"
+7
use: (from-path dir: "../sigil"))
+8
(for-repo
+9
url: "codeberg:sigil/sigil-crypto"
+10
use: (from-path dir: "../sigil-crypto"))))
manifest.scmadded
@@ -0,0 +1,11 @@
+1
;; sigil-tls Development Environment
+2
;; Use with: guix shell -m manifest.scm
+3
;;
+4
;; mbedTLS is vendored inside sigil-crypto (a from-git dependency) and
+5
;; compiled in-tree, so no system libmbedtls package is required — only
+6
;; a working C toolchain.
+7
+8
(specifications->manifest
+9
'("gcc-toolchain"
+10
"make"
+11
"pkg-config"))
package.sglmodified
@@ -9,13 +9,14 @@
9
10
(package
11
name: "sigil-tls"
+12
version: "0.13.1"
13
description: "TLS/SSL connections for Sigil"
13
url: "https://codeberg.org/sigil/sigil"
+14
url: "https://codeberg.org/sigil/sigil-tls"
15
license: "BSD-3-Clause"
16
authors: (list "David Wilson <[email protected]>")
17
18
dependencies: (list
18
(from-workspace name: "sigil-stdlib")
+19
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: "^0.13.1")
20
(from-git url: "codeberg:sigil/sigil-crypto" version: "^0.13.1"))
21
22
;; Native library definition
@@ -41,13 +42,12 @@
42
;; system from sigil-crypto's exposed c-include-dirs.
43
(compile-c-sources
44
sources: '("native/tls.c")
44
include-dirs: '("../sigil-lib/include"
45
"../sigil-lib/src")
46
flags: '("-std=c99"
47
"-Wall" "-Wextra"
48
"-Wno-unused-parameter"
49
"-D_GNU_SOURCE"
50
"-DMBEDTLS_CONFIG_FILE=\"sigil_mbedtls_config.h\""))
+45
flags: (with-sigil-c-flags
+46
'("-std=c99"
+47
"-Wall" "-Wextra"
+48
"-Wno-unused-parameter"
+49
"-D_GNU_SOURCE"
+50
"-DMBEDTLS_CONFIG_FILE=\"sigil_mbedtls_config.h\"")))
51
52
;; Create static library
53
(create-static-library
sigil.lockadded
@@ -0,0 +1,13 @@
+1
;; Auto-generated by sigil deps install. Do not edit.
+2
(lock
+3
(package name: "sigil-stdlib"
+4
url: "codeberg:sigil/sigil"
+5
ref: "^0.13.1"
+6
sha: "1aea1cecd3487bf07d071da2c1e7eb3cf4bbdb21"
+7
package-selector: "sigil-stdlib")
+8
(package name: "sigil-crypto"
+9
url: "codeberg:sigil/sigil-crypto"
+10
ref: "^0.13.1"
+11
sha: "e5a2cede45cc6130d91d251b6f818c91954b1fe5"
+12
version: "0.13.1")
+13
)