Hi JB, hi Stephan,

many thanks for your replies!

Let me describe our use case. We have a Docker Container with Karaf (4.2.7) 
exposing 2 ports (HTTP 8182, HTTPS 8444) for Camel Consumers based on the 
embedded Jetty Web Server. The SSL setup is working fine. All Camel Routes are 
defined in OSGi Blueprint.

For the different Camel Consumers we need

- Different endpoints on the same port (HTTP 8182 or HTTPS 8444) with different 
URIs (paths)
- HTTP Basic Authentication unique for every URI (path)

I started with Jetty configuration and have learned that a Security Handler in 
Jetty is bind to a port and must me unique. For this I tried to externalize the 
Security Handler in a dedicated Blueprint file and register it at OSGi Service 
Registry. The use in another Blueprint files causes an error and I've opened a 
JIRA issue for that
https://issues.apache.org/jira/browse/KARAF-6700

We came to the approach whether it could be work without this error based on 
Camel Servlet.

I think the use case (Camel HTTP Consumers on same port with different URIs, 
HTTPS and Basic Authentication unique for each Camel Consumer) is quite common. 
So I wonder if either the error with the Jetty Security Handler registration 
and re-use could be solved or an approach based on Camel Servlet would work 
easier.

Many thanks in advance for some help in this case. It's quite important to get 
our customer scenario running.

Best
- Gerald

> Siano, Stephan <[email protected]> hat am 4. Mai 2020 09:03 geschrieben:
> 
> 
> Hi Gerald,
> 
> the camel servlet component contains a CamelHttpTransportServlet. You need to 
> register this Servlet with the web container (once per container, not once 
> per endpoint).
> 
> There is also a OsgiServletRegisterer in this bundle, which can register the 
> servlet with the OSGi HTTP service, which you can use, or you can create a 
> WAB with a web.xml for that.
> 
> You do the port and the HTTPS configuration with the embedded web container 
> in Karaf (e.g. the Jetty server). Authentication is configured for the web 
> context (which might be a bit tricky for a HTTP service context, which is why 
> the web.xml path might be easier).
> 
> Best regards
> Stephan
> 
> From: Gerald Kallas - mailbox.org <[email protected]> 
> Sent: Sonntag, 3. Mai 2020 21:36
> To: [email protected]
> Subject: camel-servlet configuration of port, ssl, basic auth?
> 
> Dear community,
> 
> as camel-jetty underpinning securityHandler seems to lack of re-usability 
> (https://issues.apache.org/jira/browse/KARAF-6700,https://issues.apache.org/jira/browse/CAMEL-15000
>  
> (https://issues.apache.org/jira/browse/KARAF-6700,https:/issues.apache.org/jira/browse/CAMEL-15000))
>  I'm going to setup a http consumer based on camel-servlet following 
> https://camel.apache.org/components/latest/servlet-component.html(OSGi 
> Blueprint).
> 
> I wonder if someone could share the experience how to define
> 
> - port number
> - SSL properties
> - basic auth properties
> 
> Thanks in advance
> - Gerald

Reply via email to