Re: [RFC] TLS Session Resumption Support for Streams
| From: | Jakub Zelenka | Date: | Sun, 01 Mar 2026 19:48:45 +0000 |
| Subject: | Re: [RFC] TLS Session Resumption Support for Streams | ||
| References: | 1 2 3 4 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-130213@lists.php.net to get a copy of this message | ||
Hi,
Thanks for the feedback.
On Sun, Mar 1, 2026 at 2:05 PM Tim Düsterhus <tim@bastelstu.be> wrote:
>
> For OpenSSLSession::import() and ::export() however, the RFC mentions
> \Exception being thrown on failure. According to the “Throwable” policy
> (
>
> https://github.com/php/policies/blob/main/coding-standards-and-naming.rst#throwables),
>
> this should be an extension-specific Exception. Since the hierarchy to
> use is clearly specified in the policy, adding:
>
> class \Openssl\OpensslException extends \Exception { }
> class \Openssl\OpensslError extends \Error { }
>
> can be done without an RFC.
>
> Then the ::import() function can use `class
> \Openssl\InvalidResumptionDataException extends
> \Openssl\OpensslExceptoin { }` or similar and for ::export() just using
>
OpensslException directly is probably okay.
>
> For the OpenSSLSession class, I leave it up to you whether it makes
> sense to also move it into the Openssl namespace or not (as
> Openssl\Session). The policy leaves some freedom here, since it's not
> directly related to any of the existing classes:
>
>
>
> https://github.com/php/policies/blob/main/coding-standards-and-naming.rst#existing-non-namespaced-symbols-and-consistency
>
>
The policy recommends consistency with existing symbols and there are
already OpenSSLCertificate, OpenSSLCertificateSigningRequest and
OpenSSLAsymmetricKey. So I think we should stick with no namespace here and
calls it OpenSSLSession and OpenSSLException. I will introduce that
exception as I agree it makes more sense.
Kind regards,
Jakub