Class SslSettings


  • public class SslSettings
    extends java.lang.Object
    Settings for connecting to MongoDB via SSL.
    Since:
    3.0
    • Constructor Detail

      • SslSettings

        public SslSettings()
      • SslSettings

        public SslSettings​(JsonObject json)
    • Method Detail

      • setEnabled

        public SslSettings setEnabled​(java.lang.Boolean enabled)
        Define whether SSL should be enabled.
        Parameters:
        enabled - should be true if SSL is to be enabled.
        Returns:
        this
      • isEnabled

        public java.lang.Boolean isEnabled()
        Returns whether SSL is enabled.
        Returns:
        true if SSL is enabled.
      • setInvalidHostNameAllowed

        public SslSettings setInvalidHostNameAllowed​(java.lang.Boolean invalidHostNameAllowed)
        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
      • isInvalidHostNameAllowed

        public java.lang.Boolean isInvalidHostNameAllowed()
        Returns 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.
        Returns:
        true if invalid host names are allowed.