@Override
    public Cert getConsumerConnectionConfig(URL remoteAddress) {
        CertPair certPair = dubboCertManager.generateCert();
        if (certPair == null) {
            return null;
        }
        return new Cert(
                certPair.getCertificate().getBytes(StandardCharsets.UTF_8),
                certPair.getPrivateKey().getBytes(StandardCharsets.UTF_8),
                certPair.getTrustCerts().getBytes(StandardCharsets.UTF_8));
    }
@Test
    void getConsumerConnectionConfigTest() {
        AtomicReference<DubboCertManager> reference = new AtomicReference<>();
        try (MockedConstruction<DubboCertManager> construction =
                Mockito.mockConstruction(DubboCertManager.class, (mock, context) -> {
                    reference.set(mock);
                })) {
            FrameworkModel frameworkModel = new FrameworkModel();
            DubboCertProvider provider = new DubboCertProvider(frameworkModel);
            Assertions.assertNull(provider.getConsumerConnectionConfig(null));

            CertPair certPair = new CertPair("privateKey", "publicKey", "trustCerts", 12345);
            Mockito.when(reference.get().generateCert()).thenReturn(certPair);
            Cert connectionConfig = provider.getConsumerConnectionConfig(null);
            Assertions.assertArrayEquals("privateKey".getBytes(), connectionConfig.getPrivateKey());
            Assertions.assertArrayEquals("publicKey".getBytes(), connectionConfig.getKeyCertChain());
            Assertions.assertArrayEquals("trustCerts".getBytes(), connectionConfig.getTrustCert());

            frameworkModel.destroy();
        }
    }