-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
Affects Version/s: 3.2.2
-
Component/s: Configuration
-
None
Here is a simple test that demonstrates the issue
public class Foo { public static void main(String[] args) { String uri = "mongodb://localhost/test?ssl=true"; SocketFactory socketFactory = mock(SocketFactory.class); MongoClientOptions.Builder options = MongoClientOptions .builder() .sslEnabled(true) .socketFactory(socketFactory); MongoClient mongoClient = new MongoClient(new MongoClientURI(uri, options)); MongoClientOptions mongoClientOptions = mongoClient.getMongoClientOptions(); assertThat(mongoClientOptions.isSslEnabled()).isTrue(); assertThat(mongoClientOptions.getSocketFactory()).isEqualTo(socketFactory); } }
A call to sslEnabled will reset the factory.
- is duplicated by
-
JAVA-2242 "MongoClientOptions.builder().sslEnabled(true)" modifies the SSL factory
- Closed