protected static void configureProvidedClientCertificate(final Security security,
            final SslContextBuilder sslContextBuilder) {
        if (security.isClientAuthEnabled()) {
            try {
                final Resource privateKey = security.getPrivateKey();
                final Resource keyStore = security.getKeyStore();

                if (privateKey != null) {
                    final Resource certificateChain =
                            requireNonNull(security.getCertificateChain(), "certificateChain");
                    final String privateKeyPassword = security.getPrivateKeyPassword();
                    try (InputStream certificateChainStream = certificateChain.getInputStream();
                            InputStream privateKeyStream = privateKey.getInputStream()) {
                        sslContextBuilder.keyManager(certificateChainStream, privateKeyStream, privateKeyPassword);
                    }

                } else if (keyStore != null) {
                    final KeyManagerFactory keyManagerFactory = KeyStoreUtils.loadKeyManagerFactory(
                            security.getKeyStoreFormat(), keyStore, security.getKeyStorePassword());
                    sslContextBuilder.keyManager(keyManagerFactory);

                } else {
                    throw new IllegalStateException("Neither privateKey nor keyStore configured");
                }
            } catch (final Exception e) {
                throw new IllegalArgumentException("Failed to create SSLContext (PK/Cert)", e);
            }
        }
    }
Configures the client certificate provided 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/ShadedNettyChannelFactory.java