OpenSSL prior to 3.5.0 dereferences a NULL session pointer in
SSL_get_negotiated_group() when called on a connection where no
session is established yet, fixed in this commit:
https://github.com/openssl/openssl/commit/
4ca80d3941
Supported OpenSSL versions are not affected, but the workaround is
applied for older OpenSSL versions we keep compatibility with.
The fix is to check for the session explicitly.
int nid;
const char *name;
+#if (OPENSSL_VERSION_NUMBER < 0x30500000L)
+
+ if (SSL_get0_session(c->ssl->connection) == NULL) {
+ s->len = 0;
+ return NGX_OK;
+ }
+
+#endif
+
nid = SSL_get_negotiated_group(c->ssl->connection);
if (nid != NID_undef) {