3 Replies Latest reply on Feb 11, 2009 9:26 AM by Jonathan Anstey

    Camel and https

    Brett Levasseur Newbie

      I am trying to use the Jetty component to make a Camel endpoint that uses https. I looked at the Jetty component page on the Camel website and saw that you need to set System Properties for the keystore path (using jetty.ssl.keystore) and for the passwords (using jetty.ssl.keypassword and jetty.ssl.password). I did this and came up with the following example:

       

      public class ServerRoutes extends RouteBuilder {

       

          public void configure() throws Exception {

                

               System.setProperty("jetty.ssl.keystore", "/home/brett/workspace/Camel-https/keystore");

               System.setProperty("jetty.ssl.keypassword", "password1");

               System.setProperty("jetty.ssl.password", "password2");

       

              from("jetty:https://localhost:8443/security").

              process(new SecurityImpl()).to("file://received");

          }

      }

       

      When I try to run this I keep getting a file not found exception but the location it lists for the file is not the same as the one I specified in the System Property.

       

      ...

      2009-02-10 11:42:07.559::INFO:  jetty-6.1.14

      2009-02-10 11:42:07.592::WARN:  failed SslSocketConnector@localhost:8443

      java.io.FileNotFoundException: /home/brett/.keystore (No such file or directory)

              at java.io.FileInputStream.open(Native Method)

              at java.io.FileInputStream.(FileInputStream.java:106)

      ...

       

      Does anyone know why the Jetty component does not appear to be getting the correct path to the keystore file?

       

      Also I wrote this example using System.setProperty and DSL code. How would I write this in a Spring configuration file? I know the basic syntax for from and to, but how would I include the System Properties to indicate where the keystore is and what the passwords are? Thanks for any help.

       

      Brett

       

      Edited by: brett on Feb 10, 2009 4:59 PM