public enum ChannelEncryption extends java.lang.Enum<ChannelEncryption>
Represents different channel encryption modes.
Channel encryption uses the SSL/TLS protocol and can either be negotiated during stream negotiation with the STARTTLS command or used directly.
Enum Constant and Description |
---|
DIRECT
TLS is attempted immediately on connect to a TCP socket, like how HTTPS works, not like how STARTTLS works with any protocol.
|
DISABLED
Channel encryption via TLS is disabled, i.e. the communication channel is unencrypted (using plain text).
|
OPTIONAL
Channel encryption via TLS is optional.
|
REQUIRED
Channel encryption via TLS is required.
|
Modifier and Type | Method and Description |
---|---|
static ChannelEncryption |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ChannelEncryption[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ChannelEncryption REQUIRED
Receiving entities (servers) advertise support for STARTTLS and mark it as mandatory-to-negotiate by including an empty <required/>
element in the <starttls/>
element.
Either entity closes the connection, if TLS has not been successfully negotiated.
Also known as explicit TLS mode.
public static final ChannelEncryption OPTIONAL
Communication starts in plain text and is then optionally upgraded to a secured connection, via the STARTTLS command during stream negotiation. Initiating entities (clients) try to negotiate TLS, if the receiving entity supports it, but do not enforce it. Receiving entities (servers) advertise support for STARTTLS, but do not mark it as mandatory-to-negotiate.
This mode should be used with caution, since it's weak to a man-in-the-middle attack: an attacker could strip the STARTTLS command and the connection will be left unencrypted even if the server advertises support for TLS.
public static final ChannelEncryption DISABLED
Initiating entities (clients) neither negotiate TLS via the STARTTLS command nor connect via a non-XMPP secure transport layer. Receiving entities (servers) do not advertise support for STARTTLS in their stream features.
public static final ChannelEncryption DIRECT
Also known as implicit TLS mode.
public static ChannelEncryption[] values()
for (ChannelEncryption c : ChannelEncryption.values()) System.out.println(c);
public static ChannelEncryption valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullCopyright © 2014–2019 XMPP.rocks. All rights reserved.