Skip to content

v0.69.0

Latest

Choose a tag to compare

@yhirose yhirose released this 29 Nov 15:34

What's Changed

Build requirement

  • Mbed TLS: cpp-httplib now requires Mbed TLS built with MBEDTLS_THREADING_C, and stops with an #error otherwise. SSLServer handles connections on several threads, and Mbed TLS is not thread-safe without this option, so concurrent TLS connections could corrupt memory. Mbed TLS's default configuration leaves the option off. Distribution packages such as Debian, Ubuntu and Homebrew turn it on, so builds against them are unaffected. If your build now stops, rebuild Mbed TLS with MBEDTLS_THREADING_C (and MBEDTLS_THREADING_PTHREAD or MBEDTLS_THREADING_ALT), or define CPPHTTPLIB_MBEDTLS_SINGLE_THREADED if Mbed TLS is only ever used from one thread. Yocto's default mbedtls recipe is one such build.

Behavior changes

  • Client (Digest auth): when a server offers both qop=auth and qop=auth-int, the client now answers with auth, as curl does. auth-int hashes the body, which is empty when a content provider streams it, so those requests failed.
  • Client (Digest auth): with several Digest challenges, the client uses the first one it can answer (RFC 7616): realm and nonce present, an algorithm it implements, and a usable qop if one is given. If none qualifies, the 401 is returned without a retry. It used to look only at the first challenge, and answered an unsupported algorithm (SHA-512-256, the -sess variants) with an MD5 hash under the server's algorithm name.

Bug fixes

  • Client (Digest auth): challenge parameter names (Realm, QOP, Nonce, ...) are matched case-insensitively (#2702), as RFC 9110 requires.
  • Client (Digest auth): algorithm and qop values are matched case-insensitively, so algorithm=sha-256 is answered with SHA-256 instead of MD5.
  • Auth: several spaces after the auth scheme are accepted (RFC 9110). Digest realm=... was not recognized as Digest, and get_bearer_token_auth() returned the token of Bearer abc with a leading space.

Full Changelog: v0.68.0...v0.69.0