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