protected static void configureAcceptedServerCertificates(final Security security,
            final SslContextBuilder sslContextBuilder) {
        try {
            final Resource trustCertCollection = security.getTrustCertCollection();
            final Resource trustStore = security.getTrustStore();

            if (trustCertCollection != null) {
                try (InputStream trustCertCollectionStream = trustCertCollection.getInputStream()) {
                    sslContextBuilder.trustManager(trustCertCollectionStream);
                }

            } else if (trustStore != null) {
                final TrustManagerFactory trustManagerFactory = KeyStoreUtils.loadTrustManagerFactory(
                        security.getTrustStoreFormat(), trustStore, security.getTrustStorePassword());
                sslContextBuilder.trustManager(trustManagerFactory);

            } else {
                // Use system default
            }
        } catch (final Exception e) {
            throw new IllegalArgumentException("Failed to create SSLContext (TrustStore)", e);
        }
    }
Configures the server certificates accepted by the ssl context.

@param security The security configuration to use.
@param sslContextBuilder The ssl context builder to configure.
grpc-client-spring-boot-starter/src/main/java/net/devh/boot/grpc/client/channelfactory/NettyChannelFactory.java