Skip to content

Commit 18ec6da

Browse files
committed
Implemented FR #53447 (Cannot disable SessionTicket extension for servers that
do not support it). I haven't written a test due to the need for such a test to have a HTTPS server available which mishandles SessionTicket requests; it's likely that server administrators will gradually fix this either intentionally or through OpenSSL upgrades. That said, if there's a great clamoring for a test, I'll work one up.
1 parent d687186 commit 18ec6da

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,8 @@ PHP NEWS
152152

153153
- Improved OpenSSL extension:
154154
. Added AES support. FR #48632. (yonas dot y at gmail dot com, Pierre)
155+
. Added a "no_ticket" SSL context option to disable the SessionTicket TLS
156+
extension. FR #53447. (Adam)
155157

156158
- Improved PDO DB-LIB: (Stanley)
157159
. Added nextRowset support.

ext/openssl/xp_ssl.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,18 @@ static inline int php_openssl_setup_crypto(php_stream *stream,
369369

370370
SSL_CTX_set_options(sslsock->ctx, SSL_OP_ALL);
371371

372+
#if OPENSSL_VERSION_NUMBER >= 0x0090806fL
373+
{
374+
zval **val;
375+
376+
if (SUCCESS == php_stream_context_get_option(
377+
stream->context, "ssl", "no_ticket", &val) &&
378+
zval_is_true(*val)) {
379+
SSL_CTX_set_options(sslsock->ctx, SSL_OP_NO_TICKET);
380+
}
381+
}
382+
#endif
383+
372384
sslsock->ssl_handle = php_SSL_new_from_context(sslsock->ctx, stream TSRMLS_CC);
373385
if (sslsock->ssl_handle == NULL) {
374386
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed to create an SSL handle");

0 commit comments

Comments
 (0)