Package com.mongodb.connection
Class SslSettings.Builder
java.lang.Object
com.mongodb.connection.SslSettings.Builder
- Enclosing class:
SslSettings
@NotThreadSafe
@Deprecated(since="2021-05-27")
public static final class SslSettings.Builder
extends Object
Deprecated.
Usage of this API is not supported in AEM as a Cloud Service.
A builder for creating SSLSettings.
-
Method Summary
Modifier and TypeMethodDescriptionapplyConnectionString
(ConnectionString connectionString) Deprecated.Takes the settings from the givenConnectionString
and applies them to the builderapplySettings
(SslSettings sslSettings) Deprecated.Applies the sslSettings to the builderbuild()
Deprecated.Create a new SSLSettings from the settings in this builder.context
(SSLContext context) Deprecated.Sets the SSLContext for use when SSL is enabled.enabled
(boolean enabled) Deprecated.Define whether SSL should be enabled.invalidHostNameAllowed
(boolean invalidHostNameAllowed) Deprecated.Define whether invalid host names should be allowed.
-
Method Details
-
applySettings
Deprecated.Applies the sslSettings to the builderNote: Overwrites all existing settings
- Parameters:
sslSettings
- the sslSettings- Returns:
- this
- Since:
- 3.7
-
enabled
Deprecated.Define whether SSL should be enabled.- Parameters:
enabled
- should be true if SSL is to be enabled.- Returns:
- this
-
invalidHostNameAllowed
Deprecated.Define whether invalid host names should be allowed. Defaults to false. Take care before setting this to true, as it makes the application susceptible to man-in-the-middle attacks.- Parameters:
invalidHostNameAllowed
- whether invalid host names are allowed.- Returns:
- this
-
context
Deprecated.Sets the SSLContext for use when SSL is enabled.- Parameters:
context
- the SSLContext to use for connections. Ignored if SSL is not enabled.- Returns:
- this
- Since:
- 3.5
-
applyConnectionString
Deprecated.Takes the settings from the givenConnectionString
and applies them to the builder- Parameters:
connectionString
- the connection string containing details of how to connect to MongoDB- Returns:
- this
-
build
Deprecated.Create a new SSLSettings from the settings in this builder.- Returns:
- a new SSL settings
- Throws:
MongoInternalException
- if enabled is true, invalidHostNameAllowed is false, and the"java.version"
system property starts with 1.6
-