public static SSLContext sslContext(Config config) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, IOException, InvalidKeySpecException, KeyManagementException { return sslContext(keyManagers(config), trustManagers(config), config.isTrustCerts()); }
SSLContext sslContext = SSLUtils.sslContext(keyManagers, trustManagers, config.isTrustCerts()); httpClientBuilder.sslSocketFactory(sslContext.getSocketFactory(), trustManager); } catch (GeneralSecurityException e) {
public static SSLContext sslContext(Config config) throws CertificateException, UnrecoverableKeyException, NoSuchAlgorithmException, KeyStoreException, IOException, InvalidKeySpecException, KeyManagementException { return sslContext(keyManagers(config), trustManagers(config), config.isTrustCerts()); }
/** * Creates a {@link J4pClient} for the specified pod. * * @param kubernetes The {@link KubernetesClient} instance. * @param pod The name of the pod. * @return An instance of the {@link J4pClient}. */ private static J4pClient forPod(KubernetesClient kubernetes, String pod) { String jolokiaUrl = String.format(JOLOKIA_URL_FORMAT, kubernetes.getMasterUrl(), kubernetes.getNamespace(), pod); try { return new J4pClientBuilder() .url(jolokiaUrl) .user("user") .authenticator(new JolokiaKubernetesAuthenticator(kubernetes)) .sslConnectionSocketFactory(new SSLConnectionSocketFactory(SSLUtils.sslContext(kubernetes.getConfiguration()))) .build(); } catch (@SuppressWarnings("PMD.AvoidCatchingGenericException") Exception e) { throw SyndesisServerException.launderThrowable(e); } }
SSLContext sslContext = SSLUtils.sslContext(keyManagers, trustManagers, config.isTrustCerts()); httpClientBuilder.sslSocketFactory(sslContext.getSocketFactory(), trustManager); } catch (GeneralSecurityException e) {
/** * Creates a {@link J4pClient} for the specified pod. * * @param kubernetes The {@link KubernetesClient} instance. * @param pod The name of the pod. * @return An instance of the {@link J4pClient}. */ private static J4pClient forPod(KubernetesClient kubernetes, String pod) { String jolokiaUrl = String.format(JOLOKIA_URL_FORMAT, kubernetes.getMasterUrl(), kubernetes.getNamespace(), pod); try { return new J4pClientBuilder() .url(jolokiaUrl) .user("user") .authenticator(new JolokiaKubernetesAuthenticator(kubernetes)) .sslConnectionSocketFactory(new SSLConnectionSocketFactory(SSLUtils.sslContext(kubernetes.getConfiguration()))) .build(); } catch (@SuppressWarnings("PMD.AvoidCatchingGenericException") Exception e) { throw SyndesisServerException.launderThrowable(e); } }
if (masterUrl != null && masterUrl.toString().startsWith("https")) { try { SSLContext sslCtx = SSLUtils.sslContext(kubernetes.getConfiguration()); ConnectionSocketFactory factory = new SSLConnectionSocketFactory(sslCtx); builder = builder.sslConnectionSocketFactory(factory);