Package org.jivesoftware.smack
Enum ConnectionConfiguration.SecurityMode
- java.lang.Object
-
- java.lang.Enum<ConnectionConfiguration.SecurityMode>
-
- org.jivesoftware.smack.ConnectionConfiguration.SecurityMode
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ConnectionConfiguration.SecurityMode>
- Enclosing class:
- ConnectionConfiguration
public static enum ConnectionConfiguration.SecurityMode extends java.lang.Enum<ConnectionConfiguration.SecurityMode>
An enumeration for TLS security modes that are available when making a connection to the XMPP server.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description disabled
Security via TLS encryption is disabled and only un-encrypted connections will be used.ifpossible
Security via TLS encryption is used whenever it's available.required
Security via TLS encryption is required in order to connect.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static ConnectionConfiguration.SecurityMode
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ConnectionConfiguration.SecurityMode[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
required
public static final ConnectionConfiguration.SecurityMode required
Security via TLS encryption is required in order to connect. If the server does not offer TLS or if the TLS negotiation fails, the connection to the server will fail.
-
ifpossible
public static final ConnectionConfiguration.SecurityMode ifpossible
Security via TLS encryption is used whenever it's available. This is the default setting.Do not use this setting unless you can't use
required
. An attacker could easily perform a Man-in-the-middle attack and prevent TLS from being used, leaving you with an unencrypted (and unauthenticated) connection.
-
disabled
public static final ConnectionConfiguration.SecurityMode disabled
Security via TLS encryption is disabled and only un-encrypted connections will be used. If only TLS encryption is available from the server, the connection will fail.
-
-
Method Detail
-
values
public static ConnectionConfiguration.SecurityMode[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ConnectionConfiguration.SecurityMode c : ConnectionConfiguration.SecurityMode.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ConnectionConfiguration.SecurityMode valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
-