public abstract class AbstractClientSession extends AbstractSession implements ClientSession
ClientSession
related methodsAbstractCloseable.State
ClientSession.ClientSessionEvent
SessionHeartbeatController.HeartbeatType
AttributeRepository.AttributeKey<T>
Modifier and Type | Field and Description |
---|---|
private java.net.SocketAddress |
connectAddress |
private AttributeRepository |
connectionContext |
private java.util.List<java.lang.Object> |
identities |
private AuthenticationIdentitiesProvider |
identitiesProvider |
private KeyIdentityProvider |
keyIdentityProvider |
private PasswordIdentityProvider |
passwordIdentityProvider |
private ClientProxyConnector |
proxyConnector |
protected boolean |
sendImmediateClientIdentification |
protected boolean |
sendImmediateKexInit |
private ServerKeyVerifier |
serverKeyVerifier |
private java.util.List<UserAuthFactory> |
userAuthFactories |
private UserInteraction |
userInteraction |
channelListenerProxy, channelListeners, clientProposal, clientVersion, currentService, decodeLock, decoderBuffer, decoderLength, decoderState, encodeLock, firstKexPacketFollows, globalRequestSeqo, ignorePacketDataLength, ignorePacketsCount, ignorePacketsFrequency, ignorePacketsVariance, inBlocksCount, inBytesCount, inCipher, inCipherSize, inCompression, inMac, inMacResult, inMacSize, inPacketsCount, kex, kexFutureHolder, kexState, lastKeyTimeValue, maxRekeyBlocks, maxRekeyBytes, maxRekeyInterval, maxRekyPackets, negotiationResult, outBlocksCount, outBytesCount, outCipher, outCipherSize, outCompression, outMac, outMacSize, outPacketsCount, pendingGlobalRequest, pendingPackets, random, requestLock, seqi, seqo, serverProposal, serverVersion, SESSION, sessionId, sessionListenerProxy, sessionListeners, tunnelListenerProxy, tunnelListeners, uncompressBuffer, unmodClientProposal, unmodNegotiationResult, unmodServerProposal
authNanoStart, idleNanoStart, sessionLock
closeFuture, futureLock, state
log
REMOTE_COMMAND_WAIT_EVENTS
DEFAULT_SSH_VERSION_PREFIX, FALLBACK_SSH_VERSION_PREFIX, MAX_VERSION_LINE_LENGTH
DEFAULT_CONNECTION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_TYPE
EMPTY
CLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUT
NONE
DEFAULT_PASSWORD_PROMPTS, PASSWORD_PROMPTS, PREFERRED_AUTHS
Modifier | Constructor and Description |
---|---|
protected |
AbstractClientSession(ClientFactoryManager factoryManager,
IoSession ioSession) |
Modifier and Type | Method and Description |
---|---|
void |
addPasswordIdentity(java.lang.String password) |
void |
addPublicKeyIdentity(java.security.KeyPair kp) |
protected void |
checkKeys()
Indicates the the key exchange is completed and the exchanged keys can now be verified - e.g., client can verify
the server's key
|
ClientChannel |
createChannel(java.lang.String type)
Create a channel of the given type.
|
ClientChannel |
createChannel(java.lang.String type,
java.lang.String subType)
Create a channel of the given type and sub-type.
|
ChannelDirectTcpip |
createDirectTcpipChannel(SshdSocketAddress local,
SshdSocketAddress remote)
Create a direct tcp-ip channel which can be used to stream data to a remote port from the server.
|
ChannelExec |
createExecChannel(java.lang.String command,
PtyChannelConfigurationHolder ptyConfig,
java.util.Map<java.lang.String,?> env)
Create a channel to execute a command using specific PTY settings and/or environment.
|
ChannelShell |
createShellChannel(PtyChannelConfigurationHolder ptyConfig,
java.util.Map<java.lang.String,?> env)
Create a channel to start a shell using specific PTY settings and/or environment.
|
ChannelSubsystem |
createSubsystemChannel(java.lang.String subsystem)
Create a subsystem channel.
|
ClientProxyConnector |
getClientProxyConnector() |
java.net.SocketAddress |
getConnectAddress()
Returns the original address (after having been translated through host configuration entries if any) that was
request to connect.
|
AttributeRepository |
getConnectionContext() |
protected ConnectionService |
getConnectionService() |
ClientFactoryManager |
getFactoryManager() |
protected ForwardingFilter |
getForwardingFilter() |
KeyIdentityProvider |
getKeyIdentityProvider() |
PasswordIdentityProvider |
getPasswordIdentityProvider()
Retrieve
PasswordIdentityProvider used to provide password candidates |
AuthenticationIdentitiesProvider |
getRegisteredIdentities() |
ServerKeyVerifier |
getServerKeyVerifier()
Retrieve the server key verifier to be used to check the key when connecting to an SSH server.
|
java.util.List<UserAuthFactory> |
getUserAuthFactories()
Retrieve the list of named factories for
UserAuth objects. |
protected ClientUserAuthService |
getUserAuthService() |
UserInteraction |
getUserInteraction() |
protected void |
initializeKeyExchangePhase() |
protected void |
initializeProxyConnector() |
protected boolean |
readIdentification(Buffer buffer)
Read the other side identification.
|
protected byte[] |
receiveKexInit(Buffer buffer) |
protected void |
receiveKexInit(java.util.Map<KexProposalOption,java.lang.String> proposal,
byte[] seed) |
java.lang.String |
removePasswordIdentity(java.lang.String password) |
java.security.KeyPair |
removePublicKeyIdentity(java.security.KeyPair kp) |
protected java.lang.String |
resolveAvailableSignaturesProposal(FactoryManager manager) |
protected IoWriteFuture |
sendClientIdentification() |
protected byte[] |
sendKexInit(java.util.Map<KexProposalOption,java.lang.String> proposal)
Send the key exchange initialization packet.
|
void |
setClientProxyConnector(ClientProxyConnector proxyConnector) |
void |
setConnectAddress(java.net.SocketAddress connectAddress) |
protected void |
setKexSeed(byte... seed) |
void |
setKeyIdentityProvider(KeyIdentityProvider keyIdentityProvider) |
void |
setPasswordIdentityProvider(PasswordIdentityProvider provider) |
void |
setServerKeyVerifier(ServerKeyVerifier serverKeyVerifier) |
void |
setUserAuthFactories(java.util.List<UserAuthFactory> userAuthFactories) |
void |
setUserInteraction(UserInteraction userInteraction) |
protected void |
signalExtraServerVersionInfo(java.lang.String version,
java.util.List<java.lang.String> lines) |
SshdSocketAddress |
startDynamicPortForwarding(SshdSocketAddress local)
Start dynamic local port forwarding using a SOCKS proxy.
|
SshdSocketAddress |
startLocalPortForwarding(SshdSocketAddress local,
SshdSocketAddress remote)
Start forwarding the given local address on the client to the given address on the server.
|
SshdSocketAddress |
startRemotePortForwarding(SshdSocketAddress remote,
SshdSocketAddress local)
Start forwarding tcpip from the given address on the server to the given address on the client.
|
void |
startService(java.lang.String name,
Buffer buffer) |
void |
stopDynamicPortForwarding(SshdSocketAddress local)
Stop a previously started dynamic port forwarding.
|
void |
stopLocalPortForwarding(SshdSocketAddress local)
Stop forwarding the given local address.
|
void |
stopRemotePortForwarding(SshdSocketAddress remote)
Stop forwarding of the given remote address.
|
KeyExchangeFuture |
switchToNoneCipher()
Switch to a none cipher for performance.
|
addChannelListener, addPortForwardingEventListener, addSessionListener, appendOutgoingMac, attachSession, checkRekey, comparePreferredKexProposalOption, createBuffer, decode, doHandleMessage, doInvokeUnimplementedMessageHandler, doKexNegotiation, doWritePacket, encode, encryptOutgoingBuffer, enqueuePendingPacket, getChannelListenerProxy, getCipherInformation, getClientKexData, getClientKexProposals, getClientVersion, getCompressionInformation, getInnerCloseable, getKex, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getPortForwardingEventListenerProxy, getServerKexData, getServerKexProposals, getServerVersion, getService, getServices, getSession, getSession, getSessionId, getSessionListenerProxy, handleFirstKexPacketFollows, handleKexExtension, handleKexInit, handleKexMessage, handleMessage, handleNewCompression, handleNewKeys, handleServiceAccept, handleServiceAccept, handleServiceRequest, handleServiceRequest, isRekeyBlocksCountExceeded, isRekeyDataSizeExceeded, isRekeyPacketCountsExceeded, isRekeyRequired, isRekeyTimeIntervalExceeded, messageReceived, negotiate, notImplemented, preClose, prepareBuffer, preProcessEncodeBuffer, receiveKexInit, receiveNewKeys, reExchangeKeys, refreshConfiguration, removeChannelListener, removePortForwardingEventListener, removeSessionListener, request, requestFailure, requestNewKeysExchange, requestSuccess, resolveAvailableSignaturesProposal, resolveIgnoreBufferDataLength, resolveOutputPacket, resolveSessionKexProposal, sendKexInit, sendNewKeys, sendPendingPackets, setClientKexData, setNegotiationResult, setServerKexData, signalRequestFailure, validateIncomingMac, validateKexState, validateTargetBuffer, writePacket
attributeKeys, calculateNextIgnorePacketCount, checkAuthenticationTimeout, checkForTimeouts, checkIdleTimeout, clearAttributes, computeAttributeIfAbsent, createProposal, disconnect, doInvokeDebugMessageHandler, doInvokeIgnoreMessageHandler, doReadIdentification, exceptionCaught, getAttribute, getAttributesCount, getAuthTimeout, getAuthTimeoutStart, getBoundLocalPortForward, getBoundRemotePortForward, getChannelStreamPacketWriterResolver, getIdleTimeout, getIdleTimeoutStart, getIoSession, getLocalForwardsBindings, getParentPropertyResolver, getProperties, getRemoteForwardsBindings, getReservedSessionMessagesHandler, getSessionDisconnectHandler, getStartedLocalPortForwards, getStartedRemotePortForwards, getTimeoutStatus, getUnknownChannelReferenceHandler, getUsername, handleDebug, handleDisconnect, handleDisconnect, handleIgnore, handleUnimplemented, invokeSessionSignaller, isAuthenticated, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort, isServerSession, mergeProposals, removeAttribute, resetAuthTimeout, resetIdleTimeout, resizeKey, resolveChannelStreamPacketWriterResolver, resolveIdentificationString, resolvePeerAddress, resolveReservedSessionMessagesHandler, resolveUnknownChannelReferenceHandler, sendDebugMessage, sendIdentification, sendIgnoreMessage, sendNotImplemented, setAttribute, setAuthenticated, setChannelStreamPacketWriterResolver, setReservedSessionMessagesHandler, setSessionDisconnectHandler, setUnknownChannelReferenceHandler, setUsername, signalDisconnect, signalDisconnect, signalExceptionCaught, signalExceptionCaught, signalNegotiationEnd, signalNegotiationEnd, signalNegotiationStart, signalNegotiationStart, signalPeerIdentificationReceived, signalPeerIdentificationReceived, signalSessionClosed, signalSessionClosed, signalSessionCreated, signalSessionCreated, signalSessionEstablished, signalSessionEstablished, signalSessionEvent, signalSessionEvent, toString, writePacket
getCipherFactories, getCompressionFactories, getDelegate, getKexExtensionHandler, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKexExtensionHandler, setKeyExchangeFactories, setMacFactories, setSignatureFactories
doCloseGracefully, doCloseImmediately
addCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListener
getSimplifiedLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
auth, createDynamicPortForwardingTracker, createExecChannel, createLocalPortForwardingTracker, createRemotePortForwardingTracker, createShellChannel, executeRemoteCommand, executeRemoteCommand, executeRemoteCommand, getMetadataMap, getSessionState, passwordIteratorOf, providerOf, waitFor, waitFor
createBuffer, createBuffer, disconnect, exceptionCaught, getAuthTimeout, getAuthTimeoutStart, getIdleTimeout, getIdleTimeoutStart, getIoSession, getKex, getLocalAddress, getRemoteAddress, getService, getTimeoutStatus, prepareBuffer, reExchangeKeys, request, request, request, resetAuthTimeout, resetIdleTimeout, resolveAttribute, resolveAttribute, sendDebugMessage, sendIgnoreMessage, setAuthenticated, writePacket, writePacket, writePacket
getCipherInformation, getClientKexProposals, getClientVersion, getCompressionInformation, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getServerKexProposals, getServerVersion, getSessionId, isAuthenticated, isDataIntegrityTransport, isSecureSessionTransport, isServerSession, isValidVersionPrefix
disableSessionHeartbeat, getSessionHeartbeatInterval, getSessionHeartbeatType, setSessionHeartbeat, setSessionHeartbeat
getBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getParentPropertyResolver, getProperties, getString, getStringProperty
clearAttributes, computeAttributeIfAbsent, removeAttribute, setAttribute
attributeKeys, getAttribute, getAttributesCount, ofAttributesMap, ofKeyValuePair
addCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListener
setUsername
getUsername
getCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNames
getSignatureFactories, getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames, resolveSignatureFactories, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNames
getKexExtensionHandler, setKexExtensionHandler
addSessionListener, getSessionListenerProxy, removeSessionListener
getReservedSessionMessagesHandler, setReservedSessionMessagesHandler
getSessionDisconnectHandler, setSessionDisconnectHandler
addChannelListener, getChannelListenerProxy, removeChannelListener
getChannelStreamPacketWriterResolver, resolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolver, setChannelStreamPacketWriterResolver
addPortForwardingEventListener, getPortForwardingEventListenerProxy, removePortForwardingEventListener
getUnknownChannelReferenceHandler, resolveUnknownChannelReferenceHandler, setUnknownChannelReferenceHandler
calculatePadLength, writePacket
setUserAuthFactoriesNames
getUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactoriesNameList, setUserAuthFactoriesNames
getBoundLocalPortForward, getBoundRemotePortForward, getLocalForwardsBindings, getRemoteForwardsBindings, getStartedLocalPortForwards, getStartedRemotePortForwards, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPort
protected final boolean sendImmediateClientIdentification
protected final boolean sendImmediateKexInit
private final java.util.List<java.lang.Object> identities
private final AuthenticationIdentitiesProvider identitiesProvider
private final AttributeRepository connectionContext
private ServerKeyVerifier serverKeyVerifier
private UserInteraction userInteraction
private PasswordIdentityProvider passwordIdentityProvider
private KeyIdentityProvider keyIdentityProvider
private java.util.List<UserAuthFactory> userAuthFactories
private java.net.SocketAddress connectAddress
private ClientProxyConnector proxyConnector
protected AbstractClientSession(ClientFactoryManager factoryManager, IoSession ioSession)
public AttributeRepository getConnectionContext()
getConnectionContext
in interface ClientSession
null
if none.public ClientFactoryManager getFactoryManager()
getFactoryManager
in interface ClientSession
getFactoryManager
in interface FactoryManagerHolder
getFactoryManager
in class SessionHelper
FactoryManager
public java.net.SocketAddress getConnectAddress()
ClientSession
Session.getIoSession()
report of the remote peergetConnectAddress
in interface ClientSession
public void setConnectAddress(java.net.SocketAddress connectAddress)
public ServerKeyVerifier getServerKeyVerifier()
ClientAuthenticationManager
getServerKeyVerifier
in interface ClientAuthenticationManager
ServerKeyVerifier
to use - never null
public void setServerKeyVerifier(ServerKeyVerifier serverKeyVerifier)
setServerKeyVerifier
in interface ClientAuthenticationManager
public UserInteraction getUserInteraction()
getUserInteraction
in interface ClientAuthenticationManager
UserInteraction
object to communicate with the user (may be null
to indicate that no
such communication is allowed)public void setUserInteraction(UserInteraction userInteraction)
setUserInteraction
in interface ClientAuthenticationManager
public java.util.List<UserAuthFactory> getUserAuthFactories()
UserAuthFactoriesManager
UserAuth
objects.getUserAuthFactories
in interface UserAuthFactoriesManager<ClientSession,UserAuth,UserAuthFactory>
UserAuth
factories, never null
/emptypublic void setUserAuthFactories(java.util.List<UserAuthFactory> userAuthFactories)
setUserAuthFactories
in interface UserAuthFactoriesManager<ClientSession,UserAuth,UserAuthFactory>
public AuthenticationIdentitiesProvider getRegisteredIdentities()
getRegisteredIdentities
in interface ClientAuthenticationManager
AuthenticationIdentitiesProvider
to be used for attempting password or public key
authenticationpublic PasswordIdentityProvider getPasswordIdentityProvider()
ClientAuthenticationManager
PasswordIdentityProvider
used to provide password candidatesgetPasswordIdentityProvider
in interface ClientAuthenticationManager
PasswordIdentityProvider
instance - ignored if null
(i.e., no passwords available).ClientAuthenticationManager.addPasswordIdentity(String)
public void setPasswordIdentityProvider(PasswordIdentityProvider provider)
setPasswordIdentityProvider
in interface ClientAuthenticationManager
public KeyIdentityProvider getKeyIdentityProvider()
getKeyIdentityProvider
in interface KeyIdentityProviderHolder
KeyIdentityProvider
used to provide key-pair(s) for public key authenticationpublic void setKeyIdentityProvider(KeyIdentityProvider keyIdentityProvider)
setKeyIdentityProvider
in interface KeyIdentityProviderHolder
public ClientProxyConnector getClientProxyConnector()
getClientProxyConnector
in interface ClientProxyConnectorHolder
public void setClientProxyConnector(ClientProxyConnector proxyConnector)
setClientProxyConnector
in interface ClientProxyConnectorHolder
public void addPasswordIdentity(java.lang.String password)
addPasswordIdentity
in interface ClientAuthenticationManager
password
- Password to be added - may not be null
/empty. Note: this password is in
addition to whatever passwords are available via the PasswordIdentityProvider
(if
any)public java.lang.String removePasswordIdentity(java.lang.String password)
removePasswordIdentity
in interface ClientAuthenticationManager
password
- The password to remove - ignored if null
/emptyClientAuthenticationManager.addPasswordIdentity(String)
- or
null
if no match foundpublic void addPublicKeyIdentity(java.security.KeyPair kp)
addPublicKeyIdentity
in interface ClientAuthenticationManager
kp
- The KeyPair
to add - may not be null
Note: this key is in addition to
whatever keys are available via the KeyIdentityProvider
(if
any)public java.security.KeyPair removePublicKeyIdentity(java.security.KeyPair kp)
removePublicKeyIdentity
in interface ClientAuthenticationManager
kp
- The KeyPair
to remove - ignored if null
KeyPair
- same one that was added via ClientAuthenticationManager.addPublicKeyIdentity(KeyPair)
- or
null
if no match foundprotected void initializeKeyExchangePhase() throws java.lang.Exception
java.lang.Exception
protected void initializeProxyConnector() throws java.lang.Exception
java.lang.Exception
protected IoWriteFuture sendClientIdentification() throws java.lang.Exception
java.lang.Exception
public ClientChannel createChannel(java.lang.String type) throws java.io.IOException
ClientSession
createChannel(type, null)
.createChannel
in interface ClientSession
type
- The channel typeClientChannel
java.io.IOException
- If failed to create the requested channelpublic ClientChannel createChannel(java.lang.String type, java.lang.String subType) throws java.io.IOException
ClientSession
createChannel
in interface ClientSession
type
- The channel typesubType
- The channel sub-typeClientChannel
java.io.IOException
- If failed to create the requested channelpublic ChannelExec createExecChannel(java.lang.String command, PtyChannelConfigurationHolder ptyConfig, java.util.Map<java.lang.String,?> env) throws java.io.IOException
ClientSession
createExecChannel
in interface ClientSession
command
- The command to executeptyConfig
- The PTY configuration to use - if null
then internal defaults are usedenv
- Extra environment configuration to be transmitted to the server - ignored if
null
/empty.ChannelExec
java.io.IOException
- If failed to create the requested channelpublic ChannelSubsystem createSubsystemChannel(java.lang.String subsystem) throws java.io.IOException
ClientSession
createSubsystemChannel
in interface ClientSession
subsystem
- The subsystem nameChannelSubsystem
java.io.IOException
- If failed to create the requested channelpublic ChannelDirectTcpip createDirectTcpipChannel(SshdSocketAddress local, SshdSocketAddress remote) throws java.io.IOException
ClientSession
createDirectTcpipChannel
in interface ClientSession
local
- The local addressremote
- The remote addressChannelDirectTcpip
java.io.IOException
- If failed to create the requested channelprotected ClientUserAuthService getUserAuthService()
protected ConnectionService getConnectionService()
getConnectionService
in class SessionHelper
public SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws java.io.IOException
PortForwardingManager
startLocalPortForwarding
in interface PortForwardingManager
local
- The local addressremote
- The remote addressSshdSocketAddress
java.io.IOException
- If failed to create the requested bindingpublic void stopLocalPortForwarding(SshdSocketAddress local) throws java.io.IOException
PortForwardingManager
stopLocalPortForwarding
in interface PortForwardingManager
local
- The local addressjava.io.IOException
- If failed to cancel the requested bindingpublic SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws java.io.IOException
PortForwardingManager
Start forwarding tcpip from the given address on the server to the given address on the client.
The remote host name is the address to bind to on the server:startRemotePortForwarding
in interface PortForwardingManager
remote
- The remote addresslocal
- The local addressSshdSocketAddress
java.io.IOException
- If failed to create the requested bindingpublic void stopRemotePortForwarding(SshdSocketAddress remote) throws java.io.IOException
PortForwardingManager
stopRemotePortForwarding
in interface PortForwardingManager
remote
- The remote addressjava.io.IOException
- If failed to cancel the requested bindingpublic SshdSocketAddress startDynamicPortForwarding(SshdSocketAddress local) throws java.io.IOException
PortForwardingManager
startDynamicPortForwarding
in interface PortForwardingManager
local
- The local addressSshdSocketAddress
java.io.IOException
- If failed to create the requested bindingpublic void stopDynamicPortForwarding(SshdSocketAddress local) throws java.io.IOException
PortForwardingManager
stopDynamicPortForwarding
in interface PortForwardingManager
local
- The local addressjava.io.IOException
- If failed to cancel the requested bindingprotected ForwardingFilter getForwardingFilter()
getForwardingFilter
in class SessionHelper
protected java.lang.String resolveAvailableSignaturesProposal(FactoryManager manager)
resolveAvailableSignaturesProposal
in class AbstractSession
manager
- The FactoryManager
null
/empty if no proposalpublic void startService(java.lang.String name, Buffer buffer) throws java.lang.Exception
startService
in interface Session
name
- Service namebuffer
- Extra information provided when the service start request was receivedjava.lang.Exception
- If failed to start itpublic ChannelShell createShellChannel(PtyChannelConfigurationHolder ptyConfig, java.util.Map<java.lang.String,?> env) throws java.io.IOException
ClientSession
createShellChannel
in interface ClientSession
ptyConfig
- The PTY configuration to use - if null
then internal defaults are usedenv
- Extra environment configuration to be transmitted to the server - ignored if
null
/empty.ChannelShell
java.io.IOException
- If failed to create the requested channelprotected boolean readIdentification(Buffer buffer) throws java.lang.Exception
AbstractSession
SessionHelper.doReadIdentification(Buffer, boolean)
and store the result in the needed property.readIdentification
in class AbstractSession
buffer
- The Buffer
containing the remote identificationtrue
if the identification has been fully read or false
if more data
is neededjava.lang.Exception
- if an error occurs such as a bad protocol version or unsuccessful KEX was involvedprotected void signalExtraServerVersionInfo(java.lang.String version, java.util.List<java.lang.String> lines) throws java.lang.Exception
java.lang.Exception
protected byte[] sendKexInit(java.util.Map<KexProposalOption,java.lang.String> proposal) throws java.io.IOException
AbstractSession
sendKexInit
in class AbstractSession
proposal
- our proposal for key exchange negotiationjava.io.IOException
- if an error occurred sending the packetprotected void setKexSeed(byte... seed)
setKexSeed
in class AbstractSession
seed
- The result of the KEXINIT handshake - required for correct session key establishmentprotected byte[] receiveKexInit(Buffer buffer) throws java.lang.Exception
receiveKexInit
in class AbstractSession
java.lang.Exception
protected void receiveKexInit(java.util.Map<KexProposalOption,java.lang.String> proposal, byte[] seed) throws java.io.IOException
receiveKexInit
in class AbstractSession
java.io.IOException
protected void checkKeys() throws java.io.IOException
AbstractSession
checkKeys
in class AbstractSession
java.io.IOException
- If validation failedpublic KeyExchangeFuture switchToNoneCipher() throws java.io.IOException
ClientSession
Switch to a none cipher for performance.
This should be done after the authentication phase has been performed. After such a switch, interactive channels are not allowed anymore. Both client and server must have been configured to support the none cipher. If that's not the case, the returned future will be set with an exception.
switchToNoneCipher
in interface ClientSession
KeyExchangeFuture
that can be used to wait for the exchange to be finishedjava.io.IOException
- if a key exchange is already running