public class POP3SClient extends POP3Client
setHostnameVerifier(HostnameVerifier)
or setEndpointCheckingEnabled(boolean)
(on Java 1.7+) to enable verification.Modifier and Type | Field and Description |
---|---|
private javax.net.ssl.SSLContext |
context
The context object.
|
private static int |
DEFAULT_POP3S_PORT |
private static java.lang.String |
DEFAULT_PROTOCOL
Default secure socket protocol name, like TLS
|
private javax.net.ssl.HostnameVerifier |
hostnameVerifier
The
HostnameVerifier to use post-TLS, default null (i.e. |
private boolean |
isImplicit
The security mode.
|
private javax.net.ssl.KeyManager |
keyManager
The
KeyManager , default null. |
private java.lang.String |
protocol
The secure socket protocol to be used, like SSL/TLS.
|
private java.lang.String[] |
protocols
The protocol versions.
|
private java.lang.String[] |
suites
The cipher suites.
|
private boolean |
tlsEndpointChecking
Use Java 1.7+ HTTPS Endpoint Identification Algorithim.
|
private javax.net.ssl.TrustManager |
trustManager
The FTPS
TrustManager implementation, default null. |
_commandSupport_, _DEFAULT_ENCODING, _ERROR, _lastReplyLine, _OK, _OK_INT, _reader, _replyCode, _replyLines, _writer, AUTHORIZATION_STATE, DEFAULT_PORT, DISCONNECTED_STATE, TRANSACTION_STATE, UPDATE_STATE
_defaultPort_, _hostname_, _input_, _output_, _serverSocketFactory_, _socket_, _socketFactory_, _timeout_, connectTimeout, NETASCII_EOL
Constructor and Description |
---|
POP3SClient()
Constructor for POP3SClient, using
DEFAULT_PROTOCOL i.e. |
POP3SClient(boolean implicit)
Constructor for POP3SClient, using
DEFAULT_PROTOCOL i.e. |
POP3SClient(boolean implicit,
javax.net.ssl.SSLContext ctx)
Constructor for POP3SClient, using
DEFAULT_PROTOCOL i.e. |
POP3SClient(javax.net.ssl.SSLContext context)
Constructor for POP3SClient, using
DEFAULT_PROTOCOL - TLS - and isImplicit = false |
POP3SClient(java.lang.String proto)
Constructor for POP3SClient.
|
POP3SClient(java.lang.String proto,
boolean implicit)
Constructor for POP3SClient.
|
POP3SClient(java.lang.String proto,
boolean implicit,
javax.net.ssl.SSLContext ctx)
Constructor for POP3SClient.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_connectAction_()
Because there are so many connect() methods,
the _connectAction_() method is provided as a means of performing
some action immediately after establishing a connection,
rather than reimplementing all of the connect() methods.
|
boolean |
execTLS()
The TLS command execution.
|
java.lang.String[] |
getEnabledCipherSuites()
Returns the names of the cipher suites which could be enabled
for use on this connection.
|
java.lang.String[] |
getEnabledProtocols()
Returns the names of the protocol versions which are currently
enabled for use on this connection.
|
javax.net.ssl.HostnameVerifier |
getHostnameVerifier()
Get the currently configured
HostnameVerifier . |
private javax.net.ssl.KeyManager |
getKeyManager()
Get the
KeyManager instance. |
javax.net.ssl.TrustManager |
getTrustManager()
Get the currently configured
TrustManager . |
private void |
initSSLContext()
Performs a lazy init of the SSL context.
|
boolean |
isEndpointCheckingEnabled()
Return whether or not endpoint identification using the HTTPS algorithm
on Java 1.7+ is enabled.
|
private void |
performSSLNegotiation()
SSL/TLS negotiation.
|
void |
setEnabledCipherSuites(java.lang.String[] cipherSuites)
Controls which particular cipher suites are enabled for use on this
connection.
|
void |
setEnabledProtocols(java.lang.String[] protocolVersions)
Controls which particular protocol versions are enabled for use on this
connection.
|
void |
setEndpointCheckingEnabled(boolean enable)
Automatic endpoint identification checking using the HTTPS algorithm
is supported on Java 1.7+.
|
void |
setHostnameVerifier(javax.net.ssl.HostnameVerifier newHostnameVerifier)
Override the default
HostnameVerifier to use. |
void |
setKeyManager(javax.net.ssl.KeyManager newKeyManager)
Set a
KeyManager to use. |
void |
setTrustManager(javax.net.ssl.TrustManager newTrustManager)
Override the default
TrustManager to use. |
capa, deleteMessage, listMessage, listMessages, listUniqueIdentifier, listUniqueIdentifiers, login, login, logout, noop, reset, retrieveMessage, retrieveMessageTop, status
disconnect, getAdditionalReply, getCommandSupport, getReplyString, getReplyStrings, getState, removeProtocolCommandistener, sendCommand, sendCommand, sendCommand, sendCommand, setState
addProtocolCommandListener, connect, connect, connect, connect, connect, connect, createCommandSupport, fireCommandSent, fireReplyReceived, getCharset, getCharsetName, getConnectTimeout, getDefaultPort, getDefaultTimeout, getKeepAlive, getLocalAddress, getLocalPort, getProxy, getReceiveBufferSize, getRemoteAddress, getRemotePort, getSendBufferSize, getServerSocketFactory, getSoLinger, getSoTimeout, getTcpNoDelay, isAvailable, isConnected, removeProtocolCommandListener, setCharset, setConnectTimeout, setDefaultPort, setDefaultTimeout, setKeepAlive, setProxy, setReceiveBufferSize, setSendBufferSize, setServerSocketFactory, setSocketFactory, setSoLinger, setSoTimeout, setTcpNoDelay, verifyRemote
private static final int DEFAULT_POP3S_PORT
private static final java.lang.String DEFAULT_PROTOCOL
private final boolean isImplicit
private final java.lang.String protocol
private javax.net.ssl.SSLContext context
private java.lang.String[] suites
private java.lang.String[] protocols
private javax.net.ssl.TrustManager trustManager
TrustManager
implementation, default null.private javax.net.ssl.KeyManager keyManager
KeyManager
, default null.private javax.net.ssl.HostnameVerifier hostnameVerifier
HostnameVerifier
to use post-TLS, default null (i.e. no verification).private boolean tlsEndpointChecking
public POP3SClient()
DEFAULT_PROTOCOL
i.e. TLS
Sets security mode to explicit.public POP3SClient(boolean implicit)
DEFAULT_PROTOCOL
i.e. TLSimplicit
- The security mode, true
for implicit, false
for explicitpublic POP3SClient(java.lang.String proto)
proto
- the protocol.public POP3SClient(java.lang.String proto, boolean implicit)
proto
- the protocol.implicit
- The security mode, true
for implicit, false
for explicitpublic POP3SClient(java.lang.String proto, boolean implicit, javax.net.ssl.SSLContext ctx)
DEFAULT_POP3S_PORT
- 995 - if using implicit modeproto
- the protocol.implicit
- The security mode, true
for implicit, false
for explicitctx
- the context to be usedpublic POP3SClient(boolean implicit, javax.net.ssl.SSLContext ctx)
DEFAULT_PROTOCOL
i.e. TLSimplicit
- The security mode, true
for implicit, false
for explicitctx
- A pre-configured SSL Context.public POP3SClient(javax.net.ssl.SSLContext context)
DEFAULT_PROTOCOL
- TLS - and isImplicit = falsecontext
- A pre-configured SSL Context.POP3SClient(boolean, SSLContext)
protected void _connectAction_() throws java.io.IOException
_connectAction_
in class POP3
java.io.IOException
- If it is thrown by _connectAction_().SocketClient._connectAction_()
private void initSSLContext() throws java.io.IOException
java.io.IOException
- When could not initialize the SSL context.private void performSSLNegotiation() throws java.io.IOException
java.io.IOException
- If server negotiation fails.private javax.net.ssl.KeyManager getKeyManager()
KeyManager
instance.KeyManager
instance.public void setKeyManager(javax.net.ssl.KeyManager newKeyManager)
KeyManager
to use.newKeyManager
- The KeyManager implementation to set.KeyManagerUtils
public void setEnabledCipherSuites(java.lang.String[] cipherSuites)
cipherSuites
- The cipher suites.public java.lang.String[] getEnabledCipherSuites()
Socket
is not an SSLSocket
instance, returns null.null
.public void setEnabledProtocols(java.lang.String[] protocolVersions)
protocolVersions
- The protocol versions.public java.lang.String[] getEnabledProtocols()
Socket
is not an SSLSocket
instance, returns null.null
.public boolean execTLS() throws javax.net.ssl.SSLException, java.io.IOException
javax.net.ssl.SSLException
- If the server reply code is not positive.java.io.IOException
- If an I/O error occurs while sending
the command or performing the negotiation.public javax.net.ssl.TrustManager getTrustManager()
TrustManager
.public void setTrustManager(javax.net.ssl.TrustManager newTrustManager)
TrustManager
to use.newTrustManager
- The TrustManager implementation to set.TrustManagerUtils
public javax.net.ssl.HostnameVerifier getHostnameVerifier()
HostnameVerifier
.public void setHostnameVerifier(javax.net.ssl.HostnameVerifier newHostnameVerifier)
HostnameVerifier
to use.newHostnameVerifier
- The HostnameVerifier implementation to set or null
to disable.public boolean isEndpointCheckingEnabled()
public void setEndpointCheckingEnabled(boolean enable)
enable
- Enable automatic endpoint identification checking using the HTTPS algorithm on Java 1.7+.