@GET
    public Map<OpensearchKeystoreProvider.Store, KeyStoreDto> getCertificates() {
        Map<OpensearchKeystoreProvider.Store, KeyStoreDto> certificates = new HashMap<>();
        try {
            KeyStore keystore = datanodeKeystore.loadKeystore();
            certificates.put(OpensearchKeystoreProvider.Store.CONFIGURED, KeyStoreDto.fromKeyStore(keystore));
        } catch (DatanodeKeystoreException | KeyStoreException e) {
            log.error("Could not load datanode keystore", e);
        }
        certificates.putAll(opensearchKeystore);

        return certificates;
    }
@Test
    public void testOptionalSecurityConfiguration() throws Exception {
        when(datanodeKeystore.loadKeystore()).thenReturn(testKeyStore());
        Map<OpensearchKeystoreProvider.Store, KeyStoreDto> certificates = certificatesController.getCertificates();
        assertThat(certificates).hasSize(4);
        assertThat(certificates.get(OpensearchKeystoreProvider.Store.CONFIGURED).certificates()).hasSize(3);
        assertThat(certificates.get(OpensearchKeystoreProvider.Store.CONFIGURED).certificates().get("ca")).hasSize(1);
        assertThat(certificates.get(OpensearchKeystoreProvider.Store.CONFIGURED).certificates().get("host")).hasSize(2);
        assertThat(certificates.get(OpensearchKeystoreProvider.Store.CONFIGURED).certificates().get("cert")).hasSize(1);
        assertThat(certificates.get(OpensearchKeystoreProvider.Store.TRUSTSTORE).certificates()).hasSize(0);
    }