This example shows how to configure SSL in different scenarios:
-
one way SSL, the server exposes REST API using SSL and the client trusts the server certificate. The SSL server configuration is managed by Spring Boot and the Camel inherit it, the SSL client configuration is managed by Camel in HTTP component
-
two ways SSL, the server and the client check both certificates in a mutual trusted handshake
-
same scenario as point 1 but the server configuration is managed directly in Camel (undertow component) instead of Spring Boot
keytool installed and available on PATH
Generate certificates and keystores
$ ./generate-certificates.sh
Start ssl-server in a separate terminal:
$ mvn spring-boot:run -f ssl-server/pom.xml
Start ssl-client in a separate terminal:
$ mvn spring-boot:run -f ssl-client/pom.xml
Start ssl-server in a separate terminal:
$ mvn spring-boot:run -f ssl-server/pom.xml -Ptwoways
Start ssl-client in a separate terminal:
$ mvn spring-boot:run -f ssl-client/pom.xml -Ptwoways
Start ssl-camel-server in a separate terminal:
$ mvn spring-boot:run -f ssl-camel-server/pom.xml
Start ssl-client in a separate terminal:
$ mvn spring-boot:run -f ssl-client/pom.xml
$ curl http://localhost:8080/ping
If you hit any problem using Camel or have some feedback, then please let us know.
We also love contributors, so get involved :-)
The Camel riders!