Browse Source

[core] add remote IP to some error msgs (fixes #3122)

add remote IP to some select error msgs

x-ref:
  "Error messages should include client IP"
  https://redmine.lighttpd.net/issues/3122
master
Glenn Strauss 6 months ago
parent
commit
b1578f9548
  1. 5
      src/connections.c
  2. 6
      src/mod_openssl.c

5
src/connections.c

@ -715,10 +715,11 @@ static int connection_handle_read_state(connection * const con) {
/* expecting ASCII method beginning with alpha char
* or HTTP/2 pseudo-header beginning with ':' */
/*(TLS handshake begins with SYN 0x16 (decimal 22))*/
log_error(r->conf.errh, __FILE__, __LINE__, "%s",
log_error(r->conf.errh, __FILE__, __LINE__, "%s (%s)",
c->mem->ptr[c->offset] == 0x16
? "unexpected TLS ClientHello on clear port"
: "invalid request-line -> sending Status 400");
: "invalid request-line -> sending Status 400",
con->dst_addr_buf.ptr);
r->http_status = 400; /* Bad Request */
r->keep_alive = 0;
connection_set_state(r, CON_STATE_REQUEST_END);

6
src/mod_openssl.c

@ -3133,7 +3133,8 @@ connection_read_cq_ssl (connection * const con, chunkqueue * const cq, off_t max
if (hctx->renegotiations > 1
&& hctx->conf.ssl_disable_client_renegotiation) {
log_error(hctx->errh, __FILE__, __LINE__,
"SSL: renegotiation initiated by client, killing connection");
"SSL: renegotiation initiated by client, killing connection (%s)",
con->dst_addr_buf.ptr);
return -1;
}
@ -3245,7 +3246,8 @@ connection_read_cq_ssl (connection * const con, chunkqueue * const cq, off_t max
}
/* get all errors from the error-queue */
log_error(hctx->errh, __FILE__, __LINE__,
"SSL: %d %s", rc, ERR_error_string(ssl_err, NULL));
"SSL: %d %s (%s)", rc, ERR_error_string(ssl_err, NULL),
con->dst_addr_buf.ptr);
}
break;
}

Loading…
Cancel
Save