Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
michaelortmann opened this issue Dec 23, 2024 · 0 comments
Open

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

michaelortmann opened this issue Dec 23, 2024 · 0 comments

Comments

@michaelortmann
Copy link
Member

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) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant