creds: create on service name only

Fix creation of creds object for transfer when only a sasl service
name is configured by the application.

Follow-up to 5e99b73cf4

Closes #21591
This commit is contained in:
Stefan Eissing 2026-05-13 14:45:35 +02:00 committed by Daniel Stenberg
parent b079595f2e
commit 7f7e4e3e68
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -1436,8 +1436,9 @@ static CURLcode url_set_data_creds(struct Curl_easy *data,
Curl_creds_unlink(&data->state.creds);
if((data->set.str[STRING_USERNAME] ||
data->set.str[STRING_PASSWORD] ||
data->set.str[STRING_BEARER] ||
data->set.str[STRING_SASL_AUTHZID] ||
data->set.str[STRING_BEARER]) &&
data->set.str[STRING_SERVICE_NAME]) &&
(data->set.allow_auth_to_other_hosts ||
Curl_peer_same_destination(data->state.initial_origin, conn->origin))) {
result = Curl_creds_create(data->set.str[STRING_USERNAME],