github amberframework/amber v2.0.0-beta.17
Amber 2.0.0-beta.17

pre-release3 hours ago

Amber 2.0.0-beta.17

Amber 2.0.0-beta.17 finishes the move to Beryl: the one-release
-Duse_openssl opt-out from beta.16 is gone, and HTTPS and the mailer's TLS
run on Beryl, Amber's own TLS 1.3 written in Crystal, in every build. The
vendored Beryl moves to 0.2.5, which brings smaller TLS sockets and faster
cryptography on x86-64. Accepted connections get TCP_NODELAY by default,
compressed responses are guarded against BREACH, and the mailer now writes
its headers where mail servers expect them.

This release ships together with Grant 0.30.0, crystal-mysql 0.19.0,
asset_pipeline 0.41.0, Beryl 0.2.5, crystal-alpha 1.22.3-incremental-7 and
Amber CLI 2.0.19, which pins this Amber.

Ships with Version Commit Release
Amber CLI 2.0.19 4da80e0beb5fad6c7e9cafcc02807f996bd59855 v2.0.19
Grant 0.30.0 90b542bc7e20828834ec945941b560a676e5d3ba v0.30.0
asset_pipeline 0.41.0 29afae38c14f82c61084dbf88cd0f2b8db169afd v0.41.0
crystal-mysql 0.19.0 042276c90d2936a13002aec46e11d25830a7611b v0.19.0
Beryl 0.2.5 cc0948fd41b9026ceed2a60e601b8e3088d9a6f2 v0.2.5
crystal-alpha 1.22.3-incremental-7 35caead644e7112edbbe83d01a1b68a4d645520d v1.22.3-incremental-7

Beryl is the only TLS backend

require "amber/tls" serves HTTPS and the mailer's STARTTLS and implicit TLS
on Beryl, TLS 1.3 only. Amber::TLS::OpenSSLBackend is removed, and
Amber::TLS::Backend is always Amber::TLS::BerylBackend. A build that still
passes -Duse_openssl compiles, serves on Beryl and links no OpenSSL, so a
leftover flag in a build script does no harm. Amber::SSL#generate_tls,
Amber::TLS.compiled_in?, and the server.ssl and mailer settings are
unchanged.

Database client certificates (PostgreSQL sslcert/sslkey, MySQL
ssl-cert/ssl-key) belong to Grant and crystal-mysql. Both present them on
Beryl and removed their own -Duse_openssl opt-outs in the releases that
ship with this Amber: Grant 0.30.0 and crystal-mysql 0.19.0.

WebSocket heartbeat on a dead socket

The heartbeat (ClientSocket#beat) treats Amber::Beryl::TLS::Error on a
dead TLS socket as a disconnect, as it treats IO::Error. Closing a dead
socket writes a close frame to the same wire, which raises again; that second
error is now dropped too. Before, it escaped and ended the heartbeat fiber
with an unhandled exception, after the socket had already left
ClientSockets. A heartbeat disconnect now also runs the cleanup a peer's
close runs, once per socket (on_disconnect, channel leaves and presence,
the reconnection entry), and closes the dead wire.

TCP_NODELAY on accepted connections

The plain-HTTP listener (Amber::Server::TCPListener) and the HTTPS listener
(through Beryl::TLS::Server#tcp_nodelay) set TCP_NODELAY on every accepted
socket. server.tcp_nodelay: false (or AMBER_SERVER_TCP_NODELAY=false)
keeps Nagle on. On Linux, a relay writing many small WebSocket messages per
socket measured about 35 ms more p95 latency per message without it.

BREACH guard for compressed responses (CVE-2013-3587)

Amber::Pipe::Compression sends the identity coding to a cross-site request
that is not a top-level page load, and, for a client that sends no fetch
metadata, to a request whose Referer names another host or port.
Same-origin, same-site and user-initiated requests, and top-level page loads
from other sites, stay compressed. The rule is
Amber::Pipe::BreachGuard.may_compress_response_to?, and responses through
the pipe carry Vary: Accept-Encoding, Sec-Fetch-Site, Sec-Fetch-Mode, Sec-Fetch-Dest.

Mailer headers and DATA

Every message now carries Content-Type and Content-Transfer-Encoding in
its header block; before, they arrived as the first lines of the body
(Postfix 3.7.11 showed it). The SMTP adapter doubles a leading dot on each
body line (RFC 5321 section 4.5.2), so a line of a single dot no longer ends
the message early.

Vendored Beryl 0.2.5

The vendored copy (src/amber/vendor, Amber::Beryl) moves from 0.2.1 to
Beryl 0.2.5 (amberframework/beryl, commit cc0948fd), pinned by commit and
per-file sha256 in BERYL_VENDORED.json:

  • 0.2.2: a TLS socket keeps about 8 KiB per connection instead of about
    103 KiB.
  • 0.2.4: TCP_NODELAY on Beryl::TLS::Server's accepted sockets; AES-GCM,
    ChaCha20-Poly1305, SHA-512, RSA and P-256 on x86-64's vector and
    wide-multiply instructions, chosen at run time; X25519 and Ed25519 on a
    four-word field.
  • 0.2.5: MD5 at OpenSSL's speed or better on AMD Zen.

CHANGELOG.md has the complete list.

Upgrading

Use Amber CLI 2.0.19 for new apps. For an existing app, move the Amber pin in
shard.yml to the release commit, then run minecart update amber. No
config/ change is needed, and code changes only for the WebSocket item
below.

Check before upgrading:

  • Remove -Duse_openssl from build scripts. It no longer does anything.
  • An app whose database uses client certificates, which beta.16 told to
    build with -Duse_openssl, moves to Grant 0.30.0 for PostgreSQL and to
    crystal-mysql 0.19.0 for MySQL, and builds with no flag:
    minecart update amber grant (and the crystal-mysql pin for MySQL).
  • Every peer still needs TLS 1.3: clients of an app that serves HTTPS itself,
    the mail server, and the database (PostgreSQL 12 or later with
    ssl_min_protocol_version = 'TLSv1.3'; MySQL 8.0.16 or later with
    tls_version = TLSv1.3).
  • Every WebSocket disconnect, a peer's close included, now runs each joined
    channel's handle_leave and after_leave, and on_disconnect runs after
    the socket has left ClientSockets with its subscriptions cleared. An app
    that announces a departure in both on_disconnect and handle_leave
    announces it twice; keep per-channel work in handle_leave/after_leave.

Checks at the tagged commit

The tagged commit is the merge of amber#1491, whose head 46aa68c passed GitHub Actions run 46281048919 (7 jobs, including crystal-alpha) and CircleCI v2-beta. The merge commit has the same tree as the tested head, and on the merge commit itself run 46282501846 (7 jobs) and CircleCI v2-beta are green. Release notes: RELEASE_NOTES_V2_BETA17.md at the tag.

Commit: 500af63dc8b3b30d796b8564653b04b6181be813
Tree: 5dad72e6f8486ffb72e4268cd23b73ec7a621269
Tarball: amber-2.0.0-beta.17.tar.gz (git archive --format=tar.gz --prefix=amber-2.0.0-beta.17/ 500af63dc8b3b30d796b8564653b04b6181be813)
Tarball sha256: 7452ac57d173774696b4c1fe9623c5bfdae9bb8e417a00b454ba98b4b48d5d90
shard.lock checksum (Minecart 2025.11.25.9 and newer): sha256-v2:dad3f9d866f61dce2730da48897fcd16589edf30bf7c70e1810b57db9fa60e3a

The tarball was built twice from the commit with scripts/release_checksums.sh v2.0.0-beta.17 and gave the same sha256 both times, and the copy attached here was downloaded again and matched.

Verification

Tag: v2.0.0-beta.17 (annotated tag object 60c3020ae97d0e605fda779df06be4fc5d83deca)
Commit: 500af63dc8b3b30d796b8564653b04b6181be813
Tree: 5dad72e6f8486ffb72e4268cd23b73ec7a621269
Release asset amber-2.0.0-beta.17.tar.gz sha256: 7452ac57d173774696b4c1fe9623c5bfdae9bb8e417a00b454ba98b4b48d5d90 (built twice, equal; downloaded again after upload, equal; sidecar amber-2.0.0-beta.17.tar.gz.sha256 equal)
GitHub source archive https://github.com/amberframework/amber/archive/refs/tags/v2.0.0-beta.17.tar.gz sha256: c078f330edde98d6b1ee0c24b90fdef2953d68df0497adc97b01b06dbd5d427f (downloaded twice, equal; git get-tar-commit-id 500af63dc8b3b30d796b8564653b04b6181be813)
shard.lock checksum: sha256-v2:dad3f9d866f61dce2730da48897fcd16589edf30bf7c70e1810b57db9fa60e3a

Don't miss a new amber release

NewReleases is sending notifications on new releases.