> -         throw propagate(e);
> -      } catch (KeyManagementException e) {
> -         throw propagate(e);
> -      } catch (CertificateException e) {
> -         throw propagate(e);
> -      } catch (IOException e) {
> -         throw propagate(e);
> +      if (new File(currentCreds.identity).isFile() && new 
> File(currentCreds.credential).isFile()) {
> +         try {
> +            SSLContext sslContext = SSLContext.getInstance("TLS");
> +            X509Certificate certificate = 
> getCertificate(loadFile(currentCreds.identity));
> +            PrivateKey privateKey = 
> getKey(loadFile(currentCreds.credential));
> +            sslContext.init(new KeyManager[]{new 
> InMemoryKeyManager(certificate, privateKey)}, trustManager, new 
> SecureRandom());
> +            return sslContext;
> +         } catch (GeneralSecurityException e) {
> +            throw new AssertionError(); // The system has no TLS. Just give 
> up.

propagate a proper exception here.

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs/pull/172/files#r29742463

Reply via email to