@NotThreadSafe public static final class SslSettings.Builder extends Object
Modifier and Type | Method | Description |
---|---|---|
SslSettings.Builder |
applyConnectionString(ConnectionString connectionString) |
Takes the settings from the given
ConnectionString and applies them to the builder |
SslSettings.Builder |
applySettings(SslSettings sslSettings) |
Applies the sslSettings to the builder
|
SslSettings |
build() |
Create a new SSLSettings from the settings in this builder.
|
SslSettings.Builder |
context(SSLContext context) |
Sets the SSLContext for use when SSL is enabled.
|
SslSettings.Builder |
enabled(boolean enabled) |
Define whether SSL should be enabled.
|
SslSettings.Builder |
invalidHostNameAllowed(boolean invalidHostNameAllowed) |
Define whether invalid host names should be allowed.
|
public SslSettings.Builder applySettings(SslSettings sslSettings)
Note: Overwrites all existing settings
sslSettings
- the sslSettingspublic SslSettings.Builder enabled(boolean enabled)
enabled
- should be true if SSL is to be enabled.public SslSettings.Builder invalidHostNameAllowed(boolean invalidHostNameAllowed)
invalidHostNameAllowed
- whether invalid host names are allowed.public SslSettings.Builder context(SSLContext context)
context
- the SSLContext to use for connections. Ignored if SSL is not enabled.public SslSettings.Builder applyConnectionString(ConnectionString connectionString)
ConnectionString
and applies them to the builderconnectionString
- the connection string containing details of how to connect to MongoDBpublic SslSettings build()
MongoInternalException
- if enabled is true, invalidHostNameAllowed is false, and the "java.version"
system property starts with 1.6