You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 8, 2025. It is now read-only.
I want to get the IP address of the client on SSL server with the following code,
int sock;
sock = SSL_get_fd(s); // s is a type of SSL, sock returns right value
struct sockaddr_in peer;
socklen_t peer_len = sizeof(peer);
int ret = getpeername(sock, (struct sockaddr *) &peer, &peer_len);
I want to get the IP address of the client on SSL server with the following code,
Here ret is 0, but peer address is
(gdb) print peer
$16 = {sin_family = 10, sin_port = 37604, sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"}
Look the sin_family value is 10, that is AF_INET6, and s_addr is 0. However the client makes connection to server on IPv4.
apps/openssl s_server and s_client are used as server and client.
This is very weird, any ideas?
Many thanks,
/Kaiduan
The text was updated successfully, but these errors were encountered: