
[RFC idea] DTLS support in ext/openssl (Openssl\Dtls)
A PHP internals mailing list thread proposing DTLS (RFC 6347, the UDP counterpart of TLS) support in PHP's ext/openssl extension. The author has a working proof-of-concept featuring a transport-agnostic Openssl\Dtls class using memory BIOs, enabling use cases like WebRTC data channels, DTLS-SRTP, and CoAP. Discussion covers API design choices: using OpenSSLCertificate/OpenSSLAsymmetricKey objects vs PEM strings, enums vs integer constants for handshake states, and whether to expose DTLS as a dtls:// stream wrapper (like tls:// over tcp://) or a low-level engine. The ext/openssl maintainer (Jakub) prefers a stream wrapper approach, while the author argues both surfaces are needed — the stream for simple cases and the low-level engine for multiplexed transports like WebRTC where DTLS shares a UDP socket with STUN and SRTP.