Index: include/zbxalgo.h
===================================================================
--- include/zbxalgo.h	(revision 56413)
+++ include/zbxalgo.h	(working copy)
@@ -39,11 +39,13 @@
 
 typedef zbx_hash_t (*zbx_hash_func_t)(const void *data);
 
+zbx_hash_t	zbx_default_ptr_hash_func(const void *data);
 zbx_hash_t	zbx_default_uint64_hash_func(const void *data);
 zbx_hash_t	zbx_default_string_hash_func(const void *data);
 
 #define ZBX_DEFAULT_HASH_SEED		0
 
+#define ZBX_DEFAULT_PTR_HASH_FUNC	zbx_default_ptr_hash_func
 #define ZBX_DEFAULT_UINT64_HASH_FUNC	zbx_default_uint64_hash_func
 #define ZBX_DEFAULT_STRING_HASH_FUNC	zbx_default_string_hash_func
 
Index: src/libs/zbxalgo/algodefs.c
===================================================================
--- src/libs/zbxalgo/algodefs.c	(revision 56413)
+++ src/libs/zbxalgo/algodefs.c	(working copy)
@@ -224,6 +224,11 @@
 
 /* default hash functions */
 
+zbx_hash_t	zbx_default_ptr_hash_func(const void *data)
+{
+	return ZBX_DEFAULT_PTR_HASH_ALGO(data, ZBX_PTR_SIZE, ZBX_DEFAULT_HASH_SEED);
+}
+
 zbx_hash_t	zbx_default_uint64_hash_func(const void *data)
 {
 	return ZBX_DEFAULT_UINT64_HASH_ALGO(data, sizeof(zbx_uint64_t), ZBX_DEFAULT_HASH_SEED);
Index: src/libs/zbxdbcache/dbconfig.c
===================================================================
--- src/libs/zbxdbcache/dbconfig.c	(revision 56413)
+++ src/libs/zbxdbcache/dbconfig.c	(working copy)
@@ -1067,6 +1067,8 @@
 	unsigned char		ipmi_privilege;
 #if defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
 	ZBX_DC_PSK		*psk_i, psk_i_local;
+	zbx_ptr_pair_t		*psk_owner, psk_owner_local;
+	zbx_hashset_t		psk_owners;
 #endif
 	zabbix_log(LOG_LEVEL_DEBUG, "In %s()", __function_name);
 
@@ -1073,6 +1075,9 @@
 	zbx_vector_uint64_create(&ids);
 	zbx_vector_uint64_reserve(&ids, config->hosts.num_data + 32);
 
+#if defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
+	zbx_hashset_create(&psk_owners, 0, ZBX_DEFAULT_PTR_HASH_FUNC, ZBX_DEFAULT_PTR_COMPARE_FUNC);
+#endif
 	now = time(NULL);
 
 	while (NULL != (row = DBfetch(result)))
@@ -1215,6 +1220,8 @@
 		/* Detect errors: PSK identity without PSK value or vice versa. This should have been prevented by */
 		/* validation in frontend or API. Do not update cache in case of error. */
 
+		psk_owner = NULL;
+
 		if ('\0' != *row[28] && '\0' == *row[29])
 		{
 			zabbix_log(LOG_LEVEL_WARNING, "empty PSK for PSK identity \"%s\" configured for host \"%s\""
@@ -1270,9 +1277,18 @@
 				if (0 != strcmp(host->tls_dc_psk->tls_psk, row[29]))	/* new PSK value */
 											/* differs from old */
 				{
-					/* change underlying PSK value and 'config->psks' is updated, too */
-					DCstrpool_replace(1, &host->tls_dc_psk->tls_psk, row[29]);
-					zabbix_log(LOG_LEVEL_WARNING, "PSK value changed for identity \"%s\"", row[28]);
+					if (NULL == (psk_owner = zbx_hashset_search(&psk_owners,
+							&host->tls_dc_psk->tls_psk_identity)))
+					{
+						/* change underlying PSK value and 'config->psks' is updated, too */
+						DCstrpool_replace(1, &host->tls_dc_psk->tls_psk, row[29]);
+					}
+					else
+					{
+						zabbix_log(LOG_LEVEL_WARNING, "conflicting PSK values for PSK identity"
+								" \"%s\" on hosts \"%s\" and \"%s\" (and maybe others)",
+								psk_owner->first, psk_owner->second, host->host);
+					}
 				}
 
 				goto done;
@@ -1303,8 +1319,16 @@
 
 			if (0 != strcmp(psk_i->tls_psk, row[29]))	/* PSKid stored but PSK value is different */
 			{
-				DCstrpool_replace(1, &psk_i->tls_psk, row[29]);
-				zabbix_log(LOG_LEVEL_WARNING, "PSK value changed for identity \"%s\"", row[28]);
+				if (NULL == (psk_owner = zbx_hashset_search(&psk_owners, &psk_i->tls_psk_identity)))
+				{
+					DCstrpool_replace(1, &psk_i->tls_psk, row[29]);
+				}
+				else
+				{
+					zabbix_log(LOG_LEVEL_WARNING, "conflicting PSK values for PSK identity"
+							" \"%s\" on hosts \"%s\" and \"%s\" (and maybe others)",
+							psk_owner->first, psk_owner->second, host->host);
+				}
 			}
 
 			host->tls_dc_psk = psk_i;
@@ -1319,6 +1343,18 @@
 		psk_i_local.refcount = 1;
 		host->tls_dc_psk = zbx_hashset_insert(&config->psks, &psk_i_local, sizeof(ZBX_DC_PSK));
 done:
+		if (NULL != host->tls_dc_psk && NULL == psk_owner)
+		{
+			if (NULL == (psk_owner = zbx_hashset_search(&psk_owners, &host->tls_dc_psk->tls_psk_identity)))
+			{
+				/* register this host as the PSK identity owner, against which to report conflicts */
+
+				psk_owner_local.first = (char *)host->tls_dc_psk->tls_psk_identity;
+				psk_owner_local.second = (char *)host->host;
+
+				zbx_hashset_insert(&psk_owners, &psk_owner_local, sizeof(psk_owner_local));
+			}
+		}
 #endif
 		ZBX_STR2UCHAR(host->tls_connect, row[24]);
 		ZBX_STR2UCHAR(host->tls_accept, row[25]);
@@ -1516,6 +1552,9 @@
 
 	zbx_vector_uint64_destroy(&ids);
 
+#if defined(HAVE_POLARSSL) || defined(HAVE_GNUTLS) || defined(HAVE_OPENSSL)
+	zbx_hashset_destroy(&psk_owners);
+#endif
 	zabbix_log(LOG_LEVEL_DEBUG, "End of %s()", __function_name);
 }
 
