Skip to content

The purpose of this application is to show how to solve the problem of multiple keystores using Spring Boot + Kafka + Schema Registry + SSL.

Notifications You must be signed in to change notification settings

ivamluz/spring-kafka-schema-registry-ssl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot + Kafka + Schema Registry + SSL

The purpose of this application is to show how to solve the problem of multiple keystores using Spring Boot + Kafka + Schema Registry + SSL.

Problem description

  1. When

    • We have a Spring Boot application exposing SSL end-points with a first distinct certificate;
    • We have communication with Kafka via SSL with a second distinct certificate;
    • We have the communication with Schema Registry with the same certificate used for communication with Kafka or a separate third party certificate;
  2. Scenarios

    Protocol Spring Boot Kafka Schema Registry Result
    SSL Yes Not Not Ok
    SSL Yes Yes Not Ok
    SSL Yes Yes Yes Fail
    SSL Not Yes Yes Ok
    SSL Not Not Yes Ok
    SSL Not Not Not Ok

The failure happens in a scenario where we would expect it to be fully functional, where the application uses one certificate to securely expose endpoints, and uses other certificates to communicate with Schema Registry and Kafka.

+-------------------+            +-----------------------+
|                   |<---json--->| Schema Registry + SSL |
|                   |            +-----------------------+
| Spring Boot + SSL |
|                   |            +-----------------------+
|                   |<--binary-->|      Kafka + SSL      |  
+-------------------+            +-----------------------+

The problem identified is the kafka-avro-serializer component uses the JVM variables, javax.net.ssl.trustStore, javax.net.ssl.keyStore, javax.net.ssl.trustStorePassword and javax.net.ssl.keyStorePassword, and these variables apply to the whole application, ie if we use a certificate to export the application api it will be used for the kafka-avro-serializer component.

It is intended that the application use a certificate to expose the api and use a second certificate to communicate with the Schema Registry.

These multi-certificate feature has already been identified, you can see the discussion of the problem [here] (confluentinc/schema-registry#957), as this problem extends from last year without approval, I created the solution presented here.

About

The purpose of this application is to show how to solve the problem of multiple keystores using Spring Boot + Kafka + Schema Registry + SSL.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages