Skip to content

Commit

Permalink
mongo cert added
Browse files Browse the repository at this point in the history
  • Loading branch information
SujithaKunda committed Oct 19, 2024
1 parent 80e7217 commit f56a403
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 12 additions & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f56a403

Please sign in to comment.