@Override
    public ProviderCert getProviderConnectionConfig(URL localAddress) {
        CertPair certPair = dubboCertManager.generateCert();
        if (certPair == null) {
            return null;
        }
        return new ProviderCert(
                certPair.getCertificate().getBytes(StandardCharsets.UTF_8),
                certPair.getPrivateKey().getBytes(StandardCharsets.UTF_8),
                certPair.getTrustCerts().getBytes(StandardCharsets.UTF_8),
                AuthPolicy.NONE);
    }
@Test
    void getProviderConnectionConfigTest() {
        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.getProviderConnectionConfig(null));

            CertPair certPair = new CertPair("privateKey", "publicKey", "trustCerts", 12345);
            Mockito.when(reference.get().generateCert()).thenReturn(certPair);
            ProviderCert providerConnectionConfig = provider.getProviderConnectionConfig(null);
            Assertions.assertArrayEquals("privateKey".getBytes(), providerConnectionConfig.getPrivateKey());
            Assertions.assertArrayEquals("publicKey".getBytes(), providerConnectionConfig.getKeyCertChain());
            Assertions.assertArrayEquals("trustCerts".getBytes(), providerConnectionConfig.getTrustCert());
            Assertions.assertEquals(AuthPolicy.NONE, providerConnectionConfig.getAuthPolicy());

            frameworkModel.destroy();
        }
    }