Skip to content
vx-langPublic

About

Secure cURL

Resources

Stars

3 stars

Watchers

0 watching

Forks

Latest commit

 

History

131 Commits

Folders and files

Repository files navigation

securl

The curl command-line tool, rewritten in Vx, for HTTP/1.1, HTTP/2 and HTTPS. TLS comes from OpenSSL, a git submodule. Everything else is Vx.

Why Vx

  • No trusted code outside src/sys. The protocol code, the tool and its file access compile with --no-trusted-code. make audit lists the 348 trusted items left, 317 of them OpenSSL.
  • Capabilities. Only main holds the rights to the network, the files, the environment and the terminal, and it hands each to the code that needs it. The parsers get none.
  • Types for curl's common bugs. A connection is reused only when its whole ConnKey matches, and a password goes only where its Credential is bound.

Build

securl needs std::fs and std::net from Vx 6c2d5b1, newer than the v0.0.6 release. Until a release has them, build Vx with tools/build-vx.sh. That needs Rust, patchelf, and LLVM 22 with MLIR from apt.llvm.org.

git clone --recurse-submodules --shallow-submodules https://github.com/vx-lang/securl
cd securl
tools/build-vx.sh 6c2d5b178615bad2cc542031e5122a8d457b2b61 ~/vx
printf 'VXC = %s\nVX_LIBDIR = %s\n' ~/vx/bin/vxc ~/vx/lib > config.mk
make
build/securl https://example.com/

You also need a C compiler and Perl. Only Linux on x86-64 is tested.

Status

Tests Passed
curl's HTTP tests, from curl 2f5c657 (make test) 762 of 762
The ones that use only options securl has (make test-supported) 683 of 683
TLS, proxy and limit tests (make test-tls) 713 of 713
HTTP/2 tests (make test-h2) 48 of 48
Unit tests (make unit) 22 of 22
libFuzzer on 12 parsers, 2 minutes each (make fuzz) no crash in 35.8 million inputs
curl's 239 security advisories (docs/advisories.md) 19 ruled out by Vx, 53 checked, 4 found and fixed

docs/testing.md says how to run curl's test suite.

Features

  • HTTPS: OpenSSL 3.5, certificate checks, CRLs, OCSP stapling, pinned keys, client certificates, and HTTPS proxies.
  • HTTP/2: over TLS with ALPN, or with --http2-prior-knowledge. HPACK is in Vx.
  • Connection reuse: as libcurl, for HTTP/1.1 and HTTP/2, with up to 5 idle connections.
  • Compression: gzip, deflate, brotli and zstd, all decoded in Vx.
  • Authentication: Basic and Digest, for servers and proxies.
  • Cookies and HSTS: libcurl's cookie engine, -b, -c and --hsts.
  • Globbing: {a,b} and [1-9] in URLs, and #1 in -o.

docs/options.md lists every option.

Not done yet

  • Upgrade: h2c, HTTP/2 through a proxy, and HTTP/3.
  • Transfers at the same time: --parallel runs them one after another.
  • PKCS#12 certificates.

Layout

src/securl/   the protocol code, with no trusted code
src/cli/      the tool, and src/disk/ its files
src/sys/      the trusted code: OpenSSL, sockets and interfaces, string literals
tests/        unit, TLS, HTTP/2 and fuzz tests, and the curl test runner
tools/        build checks and fuzz scripts

docs/vx-issues.md lists the Vx issues found on the way, and CHANGELOG.md the releases.

License

curl's license (SPDX curl), in LICENSE. A binary also holds OpenSSL (Apache 2.0), the Vx runtime (Apache 2.0 with LLVM Exceptions), and brotli's dictionary (MIT).

About

Secure cURL

Resources

Stars

3 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages