Skip to content

tls 1.7.0: works alongside Mojo's std (open, listdir, get_errno)

Choose a tag to compare

@Mosaad-M Mosaad-M released this 07 Oct 18:02
· 27 commits to master since this release
2d07454

tls now works next to Mojo's standard library. No API change.

Fixed

  • Programs using tls together with open(), std.os.listdir or std.ffi.get_errno failed to compile with "existing function with conflicting signature". A Mojo program may declare each C function with only one signature, and tls declared open, read, write and __error / __errno_location with types that differ from std's. tls 1.7.0 declares none of the C functions std declares: errno comes from std.ffi.get_errno, sockets use recv / send, and files are read through std open().
  • The system CA bundle is no longer cut off at 2 MB. Larger bundles used to lose their last certificates silently.

Upgrade together

websocket ≤ 1.1.3, requests ≤ 1.2.2 and pg ≤ 1.5.2 declare some of these C functions themselves and clash with tls 1.7.0. Use websocket 1.2.0, requests 1.3.0 and pg 1.6.0, released alongside this version; mojo-pkg update picks them all up.

Testing

  • New tests/test_std_compat.mojo compiles tls next to open(), listdir, getenv, get_errno and the std clocks (CI on Linux and macOS).
  • A compile matrix (five std features × tls, tcp, websocket, requests and pg) succeeds on all 30 builds.
  • Interop: 27/27 checks against OpenSSL 3.
  • Live sweeps: 24 sites plus 4 bad endpoints all correct, and 55/55 sites connect.