code: private SSLSocketFactory buildSslSocketFactory() {
          try {
              KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType());
              keyStore.load(null, null);
              keyStore.setCertificateEntry("ca", generateCertificate());
  
              TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
              tmf.init(keyStore);
  
              SSLContext context = SSLContext.getInstance("TLSv1.2");
              context.init(null, tmf.getTrustManagers(), null);
              return context.getSocketFactory();
  
          } catch (Exception e) {
              throw new KubernetesClientException("Failure in generating SSLSocketFactory", e);
          }
      }
docs: Builds SSL Socket Factory with the public CA Certificate from Kubernetes Master.