Hi @Elaak,
Well, Kibana is in a process of migration to a so called new platform. And this config is no longer a part of the plugin contract (APIs that custom plugins have access to). Currently you can still access it through BWC hook, but there is no guarantee that it will be available in 8.0:
const legacyEsConfig = await server.newPlatform.__internals.elasticsearch.legacy.config$
.pipe(first())
.toPromise();
const hosts = legacyEsConfig.hosts;
May I ask you why you need to access this value? Also maybe it's a good time for you to start writing "New Platform" plugins (assuming the new platform provides you with all necessary APIs already, see examples here and here).
Best,
Oleg