@NotThreadSafe public static class SslSettings.Builder extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
SslSettings.Builder |
applyConnectionString(ConnectionString connectionString)
Take the settings from the given ConnectionString and set them in this 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 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
- a URI with details on how to connect to MongoDB.public SslSettings build()
MongoInternalException
- if enabled is true, invalidHostNameAllowed is false, and the "java.version"
system property starts with 1.6