diff --git a/migration/tls.c b/migration/tls.c index abb149d83253..ca1ea3bbdd45 100644 --- a/migration/tls.c +++ b/migration/tls.c @@ -49,11 +49,7 @@ migration_tls_get_creds(MigrationState *s, s->parameters.tls_creds); return NULL; } - if (ret->endpoint != endpoint) { - error_setg(errp, - "Expected TLS credentials for a %s endpoint", - endpoint == QCRYPTO_TLS_CREDS_ENDPOINT_CLIENT ? - "client" : "server"); + if (!qcrypto_tls_creds_check_endpoint(ret, endpoint, errp)) { return NULL; }