From 3575a1325e8664bf7a55c5e4c590a9a0f9d27b79 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Sat, 15 Sep 2018 12:16:23 +0900 Subject: [PATCH] nghttpx: Fix crash with plain text HTTP --- src/shrpx_http2_downstream_connection.cc | 2 +- src/shrpx_http_downstream_connection.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shrpx_http2_downstream_connection.cc b/src/shrpx_http2_downstream_connection.cc index 313c2481..beb45d9c 100644 --- a/src/shrpx_http2_downstream_connection.cc +++ b/src/shrpx_http2_downstream_connection.cc @@ -340,7 +340,7 @@ int Http2DownstreamConnection::push_request_headers() { #if OPENSSL_1_1_1_API auto conn = handler->get_connection(); - if (!SSL_is_init_finished(conn->tls.ssl)) { + if (conn->tls.ssl && !SSL_is_init_finished(conn->tls.ssl)) { nva.push_back(http2::make_nv_ll("early-data", "1")); } #endif // OPENSSL_1_1_1_API diff --git a/src/shrpx_http_downstream_connection.cc b/src/shrpx_http_downstream_connection.cc index 1bfadaa1..f087d127 100644 --- a/src/shrpx_http_downstream_connection.cc +++ b/src/shrpx_http_downstream_connection.cc @@ -590,7 +590,7 @@ int HttpDownstreamConnection::push_request_headers() { #if OPENSSL_1_1_1_API auto conn = handler->get_connection(); - if (!SSL_is_init_finished(conn->tls.ssl)) { + if (conn->tls.ssl && !SSL_is_init_finished(conn->tls.ssl)) { buf->append("Early-Data: 1\r\n"); } #endif // OPENSSL_1_1_1_API