[JAVA-2933] Mongo DB Java Driver SSL Created: 17/Aug/18  Updated: 16/Nov/21  Resolved: 17/Aug/18

Status: Closed
Project: Java Driver
Component/s: Configuration
Affects Version/s: 3.5.0
Fix Version/s: None

Type: Task Priority: Major - P3
Reporter: Siddharth Mehta Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Hi Team,

I am looking for help for SSL connection to mongo db through Java driver.

I am able to connect to Mongo with SSL using key and cert and steps mentioned in mongodb documentation.

 

JVM properties

            System.setProperty("javax.net.ssl.trustStore", <keystorePath>);

            System.setProperty("javax.net.ssl.trustStorePassword", <*******>);

            System.setProperty("javax.net.ssl.trustStoreType", "JKS");

 

            System.setProperty("javax.net.ssl.keyStore", <keystorePath>);

            System.setProperty("javax.net.ssl.keyStorePassword", <*******>);

            System.setProperty("javax.net.ssl.keyStoreType", "JKS");

options = MongoClientOptions.builder().codecRegistry(codecRegistry).connectionsPerHost(100)

                        .connectTimeout(5000).readPreference(ReadPreference.primary())

                        .threadsAllowedToBlockForConnectionMultiplier(10).maxConnectionIdleTime(600000).sslEnabled(true)

                        .sslInvalidHostNameAllowed(true).build();

 

But I am facing other problems with it, I have other functionality dependent on different certificate not working, seems setting above system property overwritten JVM cert keystore with mongodb certificate, So only mongo SSL is working, all other functionality need SSL connection failing.

Is this correct understanding or I am doing wrong. In case its overwriting what should be the solution.

 

Thanks,

Siddharth Mehta

 



 Comments   
Comment by Phil Jordan [ 17/Aug/18 ]

Hi Siddharth Mehta, 

 

We noticed that you created this issue in the Java Driver Jira project, and have moved it to the [Support Portal|https://support.mongodb.com] as you have a MongoDB Subscription. For all future questions, please raise cases through the Support Portal. This will ensure that your case is responded to as quickly as possible and SLAs are triggered.

The Support Portal will also ensure your question will remain private and your coworkers will be able to follow progress as our Support team works with you. We are looking into your questions on 00513400# now and will respond on the case shortly.

 

Thank you and have a nice day!

 

Regards,

Phil

Generated at Thu Feb 08 08:58:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.