Skip to content

Logging IP/port for incomming connections to ssl port #1724

@michaelortmann

Description

@michaelortmann

Currently, eggdrop doesnt log IPs and pots of incomming connections to ssl ports.
It would be useful, esp. in case of ssl handshake failure.

Solution would be to add some code in the beginning of tls.c:ssl_handshake()
Function parameter host might be null for incomming commections, so we would have to do something like:

if (!host) {
  struct sockaddr_in addr;
  socklen_t addr_len = sizeof(addr);
    if (getpeername(sock, (struct sockaddr *) &addr, &addr_len) == 0) {
    char host[INET_ADDRSTRLEN];
    inet_ntop(AF_INET, &(addr.sin_addr), host, INET_ADDRSTRLEN);
    int port = ntohs(addr.sin_port);
    debug2("attempting SSL negotiation from %s:%d to ...\n", host, port);
  }
}

of course for ipv6 also via something like

#ifdef IPV6
    } else if (family == AF_INET6) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions