diff --git a/docker-compose.yml b/docker-compose.yml index 1f5bb6e..4718169 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -39,6 +39,16 @@ services: MONGO_INITDB_ROOT_PASSWORD: example volumes: - mongo-data:/data/db + - ./secrets/mongo.pem:/etc/ssl/mongo.pem # Mount the server certificate + - ./secrets/ca.pem:/etc/ssl/ca.pem # Mount the CA certificate (if using a CA) + command: + - mongod + - --sslMode + - requireSSL + - --sslPEMKeyFile + - /etc/ssl/mongo.pem + - --sslCAFile + - /etc/ssl/ca.pem #sonar - code quality sonarqube: image: sonarqube diff --git a/src/main/resources/application.properties b/src/main/resources/application.properties index 559c1a6..a252e10 100644 --- a/src/main/resources/application.properties +++ b/src/main/resources/application.properties @@ -9,6 +9,17 @@ spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.Str spring.kafka.consumer.value-deserializer=org.apache.kafka.common.serialization.StringDeserializer spring.kafka.consumer.properties.session.timeout.ms=30000 spring.kafka.consumer.properties.heartbeat.interval.ms=10000 -spring.data.mongodb.uri=mongodb://root:example@localhost:27017/testMongoDb?authSource=admin mask.headers.list=pwd,pass management.endpoints.web.exposure.include = * + +spring.kafka.consumer.ssl.trust-store-location=classpath:client.keystore.jks +spring.kafka.consumer.ssl.trust-store-password=Password@1234 +spring.kafka.consumer.ssl.key-store-location=classpath:client.keystore.jks +spring.kafka.consumer.ssl.key-store-password=Password@1234 +spring.kafka.consumer.ssl.key-password=Password@1234 +spring.kafka.consumer.security.protocol=SSL + +spring.data.mongodb.uri=mongodb://root:example@localhost:27017/testMongoDb?authSource=admin&ssl=true&sslInvalidHostNameAllowed=true +spring.data.mongodb.ssl.enabled=true +spring.data.mongodb.ssl.bundle=classpath:MongoClientBundle.pem +