From e248fac362b0d2a17b9a04491b5b5ab40c2d6f45 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Thu, 2 Oct 2025 10:47:36 +0200 Subject: [PATCH] charon-cmd: Only use loose identity matching if no IDr is configured --- src/charon-cmd/cmd/cmd_connection.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/charon-cmd/cmd/cmd_connection.c b/src/charon-cmd/cmd/cmd_connection.c index aaf02c6c7..cb1660090 100644 --- a/src/charon-cmd/cmd/cmd_connection.c +++ b/src/charon-cmd/cmd/cmd_connection.c @@ -247,8 +247,9 @@ static void add_auth_cfg(private_cmd_connection_t *this, peer_cfg_t *peer_cfg, else { id = identification_create_from_string(this->host); + /* only use this if remote ID was not configured explicitly */ + auth->add(auth, AUTH_RULE_IDENTITY_LOOSE, TRUE); } - auth->add(auth, AUTH_RULE_IDENTITY_LOOSE, TRUE); } auth->add(auth, AUTH_RULE_IDENTITY, id); peer_cfg->add_auth_cfg(peer_cfg, auth, local);