public abstract class AbstractClientSession extends AbstractSession implements ClientSession
ClientSession related methodsAbstractCloseable.StateClientSession.ClientSessionEventSessionHeartbeatController.HeartbeatTypeAttributeRepository.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, unmodServerProposalauthNanoStart, idleNanoStart, sessionLockcloseFuture, futureLock, statelogREMOTE_COMMAND_WAIT_EVENTSDEFAULT_SSH_VERSION_PREFIX, FALLBACK_SSH_VERSION_PREFIX, MAX_VERSION_LINE_LENGTHDEFAULT_CONNECTION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_INTERVAL, SESSION_HEARTBEAT_TYPEEMPTYCLOSE_WAIT_TIMEOUT, DEFAULT_CLOSE_WAIT_TIMEOUTNONEDEFAULT_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, writePacketattributeKeys, 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, writePacketgetCipherFactories, getCompressionFactories, getDelegate, getKexExtensionHandler, getKeyExchangeFactories, getMacFactories, getSignatureFactories, resolveEffectiveFactories, resolveEffectiveProvider, setCipherFactories, setCompressionFactories, setKexExtensionHandler, setKeyExchangeFactories, setMacFactories, setSignatureFactoriesdoCloseGracefully, doCloseImmediatelyaddCloseFutureListener, builder, close, getFutureLock, isClosed, isClosing, removeCloseFutureListenergetSimplifiedLoggerclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitauth, createDynamicPortForwardingTracker, createExecChannel, createLocalPortForwardingTracker, createRemotePortForwardingTracker, createShellChannel, executeRemoteCommand, executeRemoteCommand, executeRemoteCommand, getMetadataMap, getSessionState, passwordIteratorOf, providerOf, waitFor, waitForcreateBuffer, 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, writePacketgetCipherInformation, getClientKexProposals, getClientVersion, getCompressionInformation, getKexNegotiationResult, getKexState, getMacInformation, getNegotiatedKexParameter, getServerKexProposals, getServerVersion, getSessionId, isAuthenticated, isDataIntegrityTransport, isSecureSessionTransport, isServerSession, isValidVersionPrefixdisableSessionHeartbeat, getSessionHeartbeatInterval, getSessionHeartbeatType, setSessionHeartbeat, setSessionHeartbeatgetBoolean, getBooleanProperty, getCharset, getInteger, getIntProperty, getLong, getLongProperty, getObject, getParentPropertyResolver, getProperties, getString, getStringPropertyclearAttributes, computeAttributeIfAbsent, removeAttribute, setAttributeattributeKeys, getAttribute, getAttributesCount, ofAttributesMap, ofKeyValuePairaddCloseFutureListener, close, close, close, getMaxCloseWaitTime, isClosed, isClosing, isOpen, removeCloseFutureListenersetUsernamegetUsernamegetCipherFactories, getCipherFactoriesNameList, getCipherFactoriesNames, getCompressionFactories, getCompressionFactoriesNameList, getCompressionFactoriesNames, getKeyExchangeFactories, getMacFactories, getMacFactoriesNameList, getMacFactoriesNames, setCipherFactories, setCipherFactoriesNameList, setCipherFactoriesNames, setCipherFactoriesNames, setCompressionFactories, setCompressionFactoriesNameList, setCompressionFactoriesNames, setCompressionFactoriesNames, setKeyExchangeFactories, setMacFactories, setMacFactoriesNameList, setMacFactoriesNames, setMacFactoriesNamesgetSignatureFactories, getSignatureFactories, getSignatureFactoriesNameList, getSignatureFactoriesNames, resolveSignatureFactories, setSignatureFactories, setSignatureFactoriesNameList, setSignatureFactoriesNames, setSignatureFactoriesNamesgetKexExtensionHandler, setKexExtensionHandleraddSessionListener, getSessionListenerProxy, removeSessionListenergetReservedSessionMessagesHandler, setReservedSessionMessagesHandlergetSessionDisconnectHandler, setSessionDisconnectHandleraddChannelListener, getChannelListenerProxy, removeChannelListenergetChannelStreamPacketWriterResolver, resolveChannelStreamPacketWriter, resolveChannelStreamPacketWriterResolver, setChannelStreamPacketWriterResolveraddPortForwardingEventListener, getPortForwardingEventListenerProxy, removePortForwardingEventListenergetUnknownChannelReferenceHandler, resolveUnknownChannelReferenceHandler, setUnknownChannelReferenceHandlercalculatePadLength, writePacketsetUserAuthFactoriesNamesgetUserAuthFactoriesNameList, getUserAuthFactoriesNames, setUserAuthFactoriesNameList, setUserAuthFactoriesNamesgetBoundLocalPortForward, getBoundRemotePortForward, getLocalForwardsBindings, getRemoteForwardsBindings, getStartedLocalPortForwards, getStartedRemotePortForwards, isLocalPortForwardingStartedForPort, isRemotePortForwardingStartedForPortprotected 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 ClientSessionnull if none.public ClientFactoryManager getFactoryManager()
getFactoryManager in interface ClientSessiongetFactoryManager in interface FactoryManagerHoldergetFactoryManager in class SessionHelperFactoryManagerpublic java.net.SocketAddress getConnectAddress()
ClientSessionSession.getIoSession() report of the remote peergetConnectAddress in interface ClientSessionpublic void setConnectAddress(java.net.SocketAddress connectAddress)
public ServerKeyVerifier getServerKeyVerifier()
ClientAuthenticationManagergetServerKeyVerifier in interface ClientAuthenticationManagerServerKeyVerifier to use - never nullpublic void setServerKeyVerifier(ServerKeyVerifier serverKeyVerifier)
setServerKeyVerifier in interface ClientAuthenticationManagerpublic UserInteraction getUserInteraction()
getUserInteraction in interface ClientAuthenticationManagerUserInteraction 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 ClientAuthenticationManagerpublic java.util.List<UserAuthFactory> getUserAuthFactories()
UserAuthFactoriesManagerUserAuth 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 ClientAuthenticationManagerAuthenticationIdentitiesProvider to be used for attempting password or public key
authenticationpublic PasswordIdentityProvider getPasswordIdentityProvider()
ClientAuthenticationManagerPasswordIdentityProvider used to provide password candidatesgetPasswordIdentityProvider in interface ClientAuthenticationManagerPasswordIdentityProvider instance - ignored if null (i.e., no passwords available).ClientAuthenticationManager.addPasswordIdentity(String)public void setPasswordIdentityProvider(PasswordIdentityProvider provider)
setPasswordIdentityProvider in interface ClientAuthenticationManagerpublic KeyIdentityProvider getKeyIdentityProvider()
getKeyIdentityProvider in interface KeyIdentityProviderHolderKeyIdentityProvider used to provide key-pair(s) for public key authenticationpublic void setKeyIdentityProvider(KeyIdentityProvider keyIdentityProvider)
setKeyIdentityProvider in interface KeyIdentityProviderHolderpublic ClientProxyConnector getClientProxyConnector()
getClientProxyConnector in interface ClientProxyConnectorHolderpublic void setClientProxyConnector(ClientProxyConnector proxyConnector)
setClientProxyConnector in interface ClientProxyConnectorHolderpublic void addPasswordIdentity(java.lang.String password)
addPasswordIdentity in interface ClientAuthenticationManagerpassword - 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 ClientAuthenticationManagerpassword - 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 ClientAuthenticationManagerkp - 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 ClientAuthenticationManagerkp - The KeyPair to remove - ignored if nullKeyPair - same one that was added via ClientAuthenticationManager.addPublicKeyIdentity(KeyPair) - or
null if no match foundprotected void initializeKeyExchangePhase()
throws java.lang.Exception
java.lang.Exceptionprotected void initializeProxyConnector()
throws java.lang.Exception
java.lang.Exceptionprotected IoWriteFuture sendClientIdentification() throws java.lang.Exception
java.lang.Exceptionpublic ClientChannel createChannel(java.lang.String type) throws java.io.IOException
ClientSessioncreateChannel(type, null).createChannel in interface ClientSessiontype - The channel typeClientChanneljava.io.IOException - If failed to create the requested channelpublic ClientChannel createChannel(java.lang.String type, java.lang.String subType) throws java.io.IOException
ClientSessioncreateChannel in interface ClientSessiontype - The channel typesubType - The channel sub-typeClientChanneljava.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
ClientSessioncreateExecChannel in interface ClientSessioncommand - 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.ChannelExecjava.io.IOException - If failed to create the requested channelpublic ChannelSubsystem createSubsystemChannel(java.lang.String subsystem) throws java.io.IOException
ClientSessioncreateSubsystemChannel in interface ClientSessionsubsystem - The subsystem nameChannelSubsystemjava.io.IOException - If failed to create the requested channelpublic ChannelDirectTcpip createDirectTcpipChannel(SshdSocketAddress local, SshdSocketAddress remote) throws java.io.IOException
ClientSessioncreateDirectTcpipChannel in interface ClientSessionlocal - The local addressremote - The remote addressChannelDirectTcpipjava.io.IOException - If failed to create the requested channelprotected ClientUserAuthService getUserAuthService()
protected ConnectionService getConnectionService()
getConnectionService in class SessionHelperpublic SshdSocketAddress startLocalPortForwarding(SshdSocketAddress local, SshdSocketAddress remote) throws java.io.IOException
PortForwardingManagerstartLocalPortForwarding in interface PortForwardingManagerlocal - The local addressremote - The remote addressSshdSocketAddressjava.io.IOException - If failed to create the requested bindingpublic void stopLocalPortForwarding(SshdSocketAddress local) throws java.io.IOException
PortForwardingManagerstopLocalPortForwarding in interface PortForwardingManagerlocal - The local addressjava.io.IOException - If failed to cancel the requested bindingpublic SshdSocketAddress startRemotePortForwarding(SshdSocketAddress remote, SshdSocketAddress local) throws java.io.IOException
PortForwardingManagerStart 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 PortForwardingManagerremote - The remote addresslocal - The local addressSshdSocketAddressjava.io.IOException - If failed to create the requested bindingpublic void stopRemotePortForwarding(SshdSocketAddress remote) throws java.io.IOException
PortForwardingManagerstopRemotePortForwarding in interface PortForwardingManagerremote - The remote addressjava.io.IOException - If failed to cancel the requested bindingpublic SshdSocketAddress startDynamicPortForwarding(SshdSocketAddress local) throws java.io.IOException
PortForwardingManagerstartDynamicPortForwarding in interface PortForwardingManagerlocal - The local addressSshdSocketAddressjava.io.IOException - If failed to create the requested bindingpublic void stopDynamicPortForwarding(SshdSocketAddress local) throws java.io.IOException
PortForwardingManagerstopDynamicPortForwarding in interface PortForwardingManagerlocal - The local addressjava.io.IOException - If failed to cancel the requested bindingprotected ForwardingFilter getForwardingFilter()
getForwardingFilter in class SessionHelperprotected java.lang.String resolveAvailableSignaturesProposal(FactoryManager manager)
resolveAvailableSignaturesProposal in class AbstractSessionmanager - The FactoryManagernull/empty if no proposalpublic void startService(java.lang.String name,
Buffer buffer)
throws java.lang.Exception
startService in interface Sessionname - 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
ClientSessioncreateShellChannel in interface ClientSessionptyConfig - 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.ChannelShelljava.io.IOException - If failed to create the requested channelprotected boolean readIdentification(Buffer buffer) throws java.lang.Exception
AbstractSessionSessionHelper.doReadIdentification(Buffer, boolean) and store the result in the needed property.readIdentification in class AbstractSessionbuffer - 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.Exceptionprotected byte[] sendKexInit(java.util.Map<KexProposalOption,java.lang.String> proposal) throws java.io.IOException
AbstractSessionsendKexInit in class AbstractSessionproposal - our proposal for key exchange negotiationjava.io.IOException - if an error occurred sending the packetprotected void setKexSeed(byte... seed)
setKexSeed in class AbstractSessionseed - The result of the KEXINIT handshake - required for correct session key establishmentprotected byte[] receiveKexInit(Buffer buffer) throws java.lang.Exception
receiveKexInit in class AbstractSessionjava.lang.Exceptionprotected void receiveKexInit(java.util.Map<KexProposalOption,java.lang.String> proposal, byte[] seed) throws java.io.IOException
receiveKexInit in class AbstractSessionjava.io.IOExceptionprotected void checkKeys()
throws java.io.IOException
AbstractSessioncheckKeys in class AbstractSessionjava.io.IOException - If validation failedpublic KeyExchangeFuture switchToNoneCipher() throws java.io.IOException
ClientSessionSwitch 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 ClientSessionKeyExchangeFuture that can be used to wait for the exchange to be finishedjava.io.IOException - if a key exchange is already running