ducaale/xh · error

This binary was built without message signature support…

Error message

This binary was built without message signature support. Enable the `http-message-signatures` feature.

What it means

Message signature support (RFC 9421 HTTP message signatures) is gated behind the optional `http-message-signatures` cargo feature. If any of the `--unstable-m-sig-*` options are supplied to a binary built without that feature, `run` returns this error because the signing code is compiled out.

Solutions

  1. Rebuild with the feature: `cargo install xh --features http-message-signatures`.
  2. Switch to an official release binary that includes the feature.
  3. Remove the `--unstable-m-sig-*` flags if signed requests are not required.

Example fix

// before
cargo install xh
xh --unstable-m-sig-id=key1 --unstable-m-sig-key=secret POST https://api.example.com
// after
cargo install xh --features http-message-signatures
xh --unstable-m-sig-id=key1 --unstable-m-sig-key=secret POST https://api.example.com
Defensive patterns

Strategy: validation

Validate before calling

# ensure the build supports message signatures before using the flags:
cargo install xh --features http-message-signatures
# or guard the script:
xh --unstable-m-sig-id=x --help >/dev/null 2>&1 || { echo 'rebuild with http-message-signatures'; exit 1; }

Prevention

When it happens

Trigger: Passing `--unstable-m-sig-id`, `--unstable-m-sig-key`, `--unstable-m-sig-alg`, or any signature component flags to an xh binary built without `--features http-message-signatures`.

Common situations: Testing draft message-signature endpoints with a default-built xh; scripts copied from docs that assume a feature-enabled build; stale binaries installed before the feature existed.

Related errors


AI-assisted analysis of ducaale/xh@2404aceecc (2026-09-13). Data as JSON: /api/errors/25a6d3fd8efcf4aa. Report an issue: GitHub.

Appendix: source

Thrown at src/main.rs:598

                    *body = ReqwestBody::from(output);
                    request
                        .headers_mut()
                        .insert(CONTENT_ENCODING, HeaderValue::from_static("deflate"));
                }
            }
        }

        for header in &headers_to_unset {
            request.headers_mut().remove(header);
        }

        #[cfg(not(feature = "http-message-signatures"))]
        if args.m_sig.m_sig_id.is_some()
            || args.m_sig.m_sig_key.is_some()
            || args.m_sig.m_sig_alg.is_some()
            || args.m_sig.has_components()
        {
            return Err(anyhow!(
                "This binary was built without message signature support. Enable the `http-message-signatures` feature."
            ));
        }

        #[cfg(feature = "http-message-signatures")]
        if args.m_sig.has_components() && !args.m_sig.has_key_pair() {
            return Err(anyhow!(
                "Message signature components require both --unstable-m-sig-id and --unstable-m-sig-key."
            ));
        }

        #[cfg(feature = "http-message-signatures")]
        if let Some((key_id, key_material)) = args.m_sig.key_pair() {
            let m_sig_components = args.m_sig.flattened_components();
            let m_sig_algorithm = args.m_sig.algorithm().map(Into::into);
            message_signature::sign_request(
                &mut request,
                key_id,

View on GitHub (pinned to 2404aceecc)