openssl_get_channel_binding() proposal
Draft; not accepted. The RFC page (version 0.1, dated 2026-10-27, author Sjoerd Langkemper) was created at 09:14 UTC on 27 October with the status Draft. The author announced it on internals at about 09:26 UTC. The page's discussion and voting thread fields still read "tbd", and when checked at about 11:05 UTC the RFC was not yet in the official RFC index (955 entries). It proposes the next minor version (PHP 8.7) and says the feature is not eligible for a backport. The implementation is php-src PR #24035, which the RFC calls a proof of concept.
Proposal
ext/openssl would gain a function and an enum in the existing Openssl namespace:
openssl_get_channel_binding($stream, Openssl\ChannelBindingType $channel_binding_type): ?stringenum Openssl\ChannelBindingType: stringwith the casesTlsUnique(tls-unique),TlsServerEndPoint(tls-server-end-point) andTlsExporter(tls-exporter); the backing values are the IANA channel binding type names.
The function returns the raw, binary TLS channel binding data of a connected stream that uses an OpenSSL transport
(ssl://, tls:// or a version-specific transport such as tlsv1.2://) after the handshake has completed. It works on
client and server streams, does not perform a handshake and does not accept a stream context, because a context can create
several connections. The type parameter is required, with no default. It returns null when the requested type does not
apply to the connection; according to the RFC this currently happens only for tls-unique over TLS 1.3, where that
binding type is not defined.
The stated motivation is SASL: userland libraries implement SCRAM, but cannot implement the SCRAM-SHA-*-PLUS variants
(RFC 5802/7677) because PHP exposes no way to get the binding data from a TLS stream. The RFC names PEAR Net_SMTP and
Auth_SASL, Roundcube, SnappyMail, SquirrelMail and Horde as examples, and php-src issue #16766 as the original request.
It cites CPython's ssl.SSLSocket.get_channel_binding() as prior art, which implements only tls-unique.
Design decisions and limitations recorded in the RFC
- An enum instead of the string parameter that the PR currently accepts; the PR "will be updated for the enum
parameter". A
ChannelBindingType|stringunion, integer constants and astream_get_channel_binding()name were rejected.tls-unique-for-telnetis left out as Telnet-specific. - An inapplicable type returns
nullrather than throwing, so callers can fall back to another type. - Security considerations: channel binding data is not secret (RFC 5929 section 10), but applications must use the type
that the negotiated SASL mechanism expects and must not treat a missing binding as an authenticated connection. The RFC
describes
tls-exporteras the choice for TLS 1.3 andtls-uniqueas meaningful only for TLS 1.2 and earlier. - Backward compatibility: only the new global function name and the new class name are added. The function exists only when ext/openssl is loaded and, according to the RFC, cannot be polyfilled in userland.
- The planned vote is one question requiring a 2/3 majority. The page shows an empty poll template (0–0–0, "closed") with no dates; no vote has been opened.
The PR's code and tests were not checked here. The RFC says the PR contains PHPT tests for TLS 1.2 and 1.3 and was tested manually against Prosody and PostgreSQL. At about 11:05 UTC there were no replies on the list.
Related: 27 October 2026 digest.