You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Tomas Veskrna (JIRA)" <ji...@apache.org> on 2019/03/13 09:26:00 UTC

[jira] [Closed] (CAMEL-13251) Restlet when used as client use wrong SSL context

     [ https://issues.apache.org/jira/browse/CAMEL-13251?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tomas Veskrna  closed CAMEL-13251.
----------------------------------
    Resolution: Not A Bug

> Restlet when used as client use wrong SSL context
> -------------------------------------------------
>
>                 Key: CAMEL-13251
>                 URL: https://issues.apache.org/jira/browse/CAMEL-13251
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-restlet
>    Affects Versions: 2.23.1
>            Reporter: Tomas Veskrna 
>            Priority: Minor
>
> Discovered during testing link CAMEL-12744.
> I create test: [https://github.com/tveskrna/camel/commit/03ca7817676728ed538cbf0d1d003867a33819c9] when Restlet producer using SSL. This test fails. In closer view you can find it is SSL handshake error.
> When you replace code on: [https://github.com/apache/camel/blob/master/components/camel-restlet/src/main/java/org/apache/camel/component/restlet/RestletProducer.java#L59]
> with:
> {code:java}
> final KeyStore ks = KeyStore.getInstance("JKS");
> ks.load(new FileInputStream(new File("path/to/keystore/in/restlet")), "changeit".toCharArray());
> final KeyManagerFactory kmf = KeyManagerFactory.getInstance(Security.getProperty("ssl.KeyManagerFactory.algorithm"));
> kmf.init(ks, "changeit".toCharArray());
> final TrustManagerFactory tmf = TrustManagerFactory.getInstance(Security.getProperty("ssl.KeyManagerFactory.algorithm"));
> tmf.init(ks);
> final SSLContext sslContext = SSLContext.getInstance("TLS"); 
> sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null);
> return sslContext; {code}
> you can find out there is problem in type of SSL Context and replacing it with right SSL Context, it starts work.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)