Even during execution of a request it is possible that there will be
no session available, notably in case of renegotiation. As a result
logging of $ssl_session_id in some cases caused NULL pointer dereference
after revision
97e3769637a7 (1.5.9). The check added returns an empty
string if there is no session available.
SSL_SESSION *sess;
sess = SSL_get0_session(c->ssl->connection);
+ if (sess == NULL) {
+ s->len = 0;
+ return NGX_OK;
+ }
buf = sess->session_id;
len = sess->session_id_length;