How to configure SSL mongodb connection in yml file spring boot? I was trying to setup ssl mongodb connection from spring boot but I couldn't able to find a way. How can I add pem and ca file to below connection?

Please note I am using replica set

data:
     mongodb:
         authentication-database: admin
         database: &lt;database&gt;
         host: &lt;host&gt;
         password: &lt;password&gt;
         port: &lt;port&gt;
         username: &lt;username&gt;
You can try a configuration like the one below;

server:
    ssl:
        key-store: classpath:keystore.jks
        key-store-password: secret
        key-password: another-secret
data:
     mongodb:
        authentication-database: admin
        database: &lt;database&gt;
        host: &lt;host&gt;
        password: &lt;password&gt;
        port: &lt;port&gt;
        username: &lt;username&gt;
        ssl-enabled: true