OpenSSL 3.0 "helpfully" treats an unclean TLS session shutdown as an
error, flooding our logs and killing TLS session resumption. We do
not care about a possible "truncation attack" since we already know
how many bytes we are supposed to get, so we can ignore this.
#endif
}
+#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
+ sslOptions |= SSL_OP_IGNORE_UNEXPECTED_EOF;
+#endif
+
SSL_CTX_set_options(ctx.get(), sslOptions);
if (!libssl_set_min_tls_version(ctx, config.d_minTLSVersion)) {
throw std::runtime_error("Failed to set the minimum version to '" + libssl_tls_version_to_string(config.d_minTLSVersion));
SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION |
SSL_OP_SINGLE_DH_USE |
SSL_OP_SINGLE_ECDH_USE |
+#ifdef SSL_OP_IGNORE_UNEXPECTED_EOF
+ SSL_OP_IGNORE_UNEXPECTED_EOF |
+#endif
SSL_OP_CIPHER_SERVER_PREFERENCE;
if (!params.d_enableRenegotiation) {
#ifdef SSL_OP_NO_RENEGOTIATION