@NotThreadSafe public static final class SslSettings.Builder extends java.lang.Object
Modifier and Type | Method and 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(javax.net.ssl.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(javax.net.ssl.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.6Copyright © 2010 - 2020 Adobe. All Rights Reserved