client->real_remote_ip = conn->real_remote_ip;
client->real_remote_port = conn->real_remote_port;
client->listener_name = p_strdup(client->pool, conn->name);
-
client->trusted = client_is_trusted(client);
- client->secured = ssl || client->trusted ||
- net_ip_compare(&conn->real_remote_ip, &conn->real_local_ip);
+
+ if (conn->proxied) {
+ client->secured = conn->proxy.ssl || client->trusted;
+ client->local_name = conn->proxy.hostname;
+ client->client_cert_common_name = conn->proxy.cert_common_name;
+ } else {
+ client->secured = ssl || client->trusted ||
+ net_ip_compare(&conn->real_remote_ip, &conn->real_local_ip);
+ }
client->proxy_ttl = LOGIN_PROXY_TTL;
if (last_client == NULL)
const struct master_service_ssl_settings *ssl_set;
const char *session_id, *listener_name, *postlogin_socket_path;
const char *local_name;
+ const char *client_cert_common_name;
+
string_t *client_id;
string_t *forward_fields;
info.mech = mech->name;
info.service = service;
info.session_id = client_get_session_id(client);
- info.cert_username = client->ssl_proxy == NULL ? NULL :
- ssl_proxy_get_peer_name(client->ssl_proxy);
+ if (client->client_cert_common_name != NULL)
+ info.cert_username = client->client_cert_common_name;
+ else if (client->ssl_proxy != NULL)
+ info.cert_username = ssl_proxy_get_peer_name(client->ssl_proxy);
info.flags = client_get_auth_flags(client);
info.local_ip = client->local_ip;
info.remote_ip = client->ip;