[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-28 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17047718#comment-17047718
 ] 

Lyor Goldstein commented on SSHD-968:
-

{quote}
Sorry, but the git link in 
https://github.com/lgoldstein/mina-sshd/tree/SSHD-968 is bad. When I download 
it, I get to version 1.7.0
{quote}
I should have been clearer - the idea is to clone and then checkout branch 
SSHD-968
{quote}
UPDATE: the zip seems to be ok. I will do the verification on the zip instead.
{quote}
Strange, since you claim the version is 1.7.0...
{quote}
Feel free to merge whenever you want. Thanks for the quick support.
{quote}
Good news - will do.


> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-28 Thread Patrik Ek (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17047712#comment-17047712
 ] 

Patrik Ek commented on SSHD-968:


Hi,

This seems to work. 

2020-02-28T15:49:40,218 DEBUG  
request(ClientSessionImpl[root@/192.168.10.220:830]) 
request=keepal...@openssh.com, timeout=5000 MILLISECONDS
2020-02-28T15:49:40,218 DEBUG  
preProcessEncodeBuffer(ClientSessionImpl[root@/192.168.10.220:830]) outgoing 
SSH_MSG_GLOBAL_REQUEST seqNo=-1 => 16
2020-02-28T15:49:40,218 DEBUG  
encode(ClientSessionImpl[root@/192.168.10.220:830]) packet #16 sending 
command=80[SSH_MSG_GLOBAL_REQUEST] len=27
2020-02-28T15:49:40,218 TRACE  
encode(ClientSessionImpl[root@/192.168.10.220:830]) packet #16 [chunk 
#1](27/27) 50 00 00 00 15 6b 65 65 70 61 6c 69 76 65 40 6f 70 65 6e 73 73 68 2e 
63 6f 6d 01 
  pkeepal...@openssh.com.
2020-02-28T15:49:40,218 TRACE  
encode(ClientSessionImpl[root@/192.168.10.220:830]) packet #16 
command=80[SSH_MSG_GLOBAL_REQUEST] len=44, pad=16, mac=BaseMac[HmacSHA256] -  
block=32/32 bytes, encrypt-then-mac=false
2020-02-28T15:49:40,218 DEBUG  
writePacket(Nio2Session[local=/0:0:0:0:0:0:0:0:59756, 
remote=/192.168.10.220:830]) Writing 80 bytes
2020-02-28T15:49:40,218 DEBUG  
request(ClientSessionImpl[root@/192.168.10.220:830])[keepal...@openssh.com] 
sent with seqNo=16
2020-02-28T15:49:40,218 TRACE  
request(ClientSessionImpl[root@/192.168.10.220:830])[keepal...@openssh.com] 
remaining wait=5000
2020-02-28T15:49:40,219 DEBUG  
handleCompletedWriteCycle(Nio2Session[local=/0:0:0:0:0:0:0:0:59756, 
remote=/192.168.10.220:830]) finished writing len=80
2020-02-28T15:49:40,222 DEBUG  
handleReadCycleCompletion(Nio2Session[local=/0:0:0:0:0:0:0:0:59756, 
remote=/192.168.10.220:830]) read 48 bytes
2020-02-28T15:49:40,222 TRACE  
decode(ClientSessionImpl[root@/192.168.10.220:830]) packet #59 [chunk #1](5/5) 
03 00 00 00 10  

   .
2020-02-28T15:49:40,222 TRACE  
doHandleMessage(ClientSessionImpl[root@/192.168.10.220:830]) process 
SSH_MSG_UNIMPLEMENTED
2020-02-28T15:49:40,222 DEBUG  
doInvokeUnimplementedMessageHandler(ClientSessionImpl[root@/192.168.10.220:830])
 report global request=keepal...@openssh.com failure for seqNo=16
2020-02-28T15:49:40,222 DEBUG  
request(ClientSessionImpl[root@/192.168.10.220:830]) 
request=keepal...@openssh.com, timeout=5000 MILLISECONDS, requestSeqNo=16, 
result received=true

{color:#172b4d}Feel free to merge whenever you want. Thanks for the quick 
support.{color}

BR
Patrik

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existin

[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-28 Thread Patrik Ek (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17047657#comment-17047657
 ] 

Patrik Ek commented on SSHD-968:


[~lgoldstein] Sorry, but the git link in

[https://github.com/lgoldstein/mina-sshd/tree/SSHD-968]

is bad. When I download it, I get to version 1.7.0

BR
Patrik

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-27 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046855#comment-17046855
 ] 

Lyor Goldstein commented on SSHD-968:
-

[~patrikek] Please test https://github.com/lgoldstein/mina-sshd/tree/SSHD-968 
code - I prefer delaying merging it to allow for some "field testing" besides 
the unit test in place.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>  Time Spent: 1h
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-27 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046600#comment-17046600
 ] 

Lyor Goldstein commented on SSHD-968:
-

[~gnodet] See https://github.com/apache/mina-sshd/pull/114 (code is available 
at https://github.com/lgoldstein/mina-sshd/tree/SSHD-968). I adopted your 
excellent idea + test, just implemented it in (IMO) a slightly more general way 
that we can hopefully use in the future for other features/issues

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-27 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046340#comment-17046340
 ] 

Lyor Goldstein commented on SSHD-968:
-

I am using the test you wrote to make sure the problem is fixed (BTW, it had a 
slight error since it did not  restore the {{HEARTBEAT_REPLY_WAIT}} value in 
the {{tearDown}} method, thus causing some other tests to fail if it ran before 
them.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-27 Thread Guillaume Nodet (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046328#comment-17046328
 ] 

Guillaume Nodet commented on SSHD-968:
--

The additional arguments were added to remove access to a field variable which 
could require extra care for synchronization.  But feel free to propose a 
better fix, np.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-27 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046313#comment-17046313
 ] 

Lyor Goldstein commented on SSHD-968:
-

The suggested fix seems to involve too many methods changes - not mention the 
fact that the extra argument is very specific to this issue. What if future 
fixes require more argument ? However, your fix has given me an idea I would 
like to explore that may provide (IMO) a better solution. Be patient for 1-2 
days and I might have something.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Guillaume Nodet
>Priority: Major
>  Time Spent: 20m
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-26 Thread Guillaume Nodet (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046296#comment-17046296
 ] 

Guillaume Nodet commented on SSHD-968:
--

[~patrikek] I did push another commit to 
[https://github.com/apache/mina-sshd/pull/112] to fix the problems, feel free 
to give it a try.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Guillaume Nodet
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-26 Thread Patrik Ek (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17046273#comment-17046273
 ] 

Patrik Ek commented on SSHD-968:


No worries [~gnodet] just let me know when things are done and you want me to 
verify.

BR
Patrik

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Guillaume Nodet
>Priority: Major
>  Time Spent: 10m
>  Remaining Estimate: 0h
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-25 Thread Guillaume Nodet (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17045212#comment-17045212
 ] 

Guillaume Nodet commented on SSHD-968:
--

[~lgoldstein] well spotted
[~patrikek] I'll see if I can find a slightly better way.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Guillaume Nodet
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-25 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044705#comment-17044705
 ] 

Lyor Goldstein commented on SSHD-968:
-

Sorry - I take it back - I think it won't work. The reason is that 
{{writePacket}} might actually write out 2 packets instead of one due to 
"message stuffing" using {{SSH_MSG_IDLE}} (part of the security 
recommendations). If you want to capture the real outgoing sequence number it 
must occur in {{encode(Buffer)}}.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Guillaume Nodet
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-25 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17044658#comment-17044658
 ] 

Lyor Goldstein commented on SSHD-968:
-

Very elegant - one small remark though (see comment in the commit). [~patrikek] 
can you test this fix ?

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Guillaume Nodet
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-24 Thread Guillaume Nodet (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17043948#comment-17043948
 ] 

Guillaume Nodet commented on SSHD-968:
--

[~patrikek] do you want to have a look at the following commit 
https://github.com/gnodet/mina-sshd/commit/24eb4ffbf97311a816fff1e59ac257e9edabd441
It's a bit of a hack but it could work.  If you could validate that it actually 
fix the issue, I'll commit the patch.

[~lgoldstein] feel free to have a look at the commit, I think I found a way to 
keep the internals... internal, while still supporting this badly behaving 
server.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Guillaume Nodet
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-23 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17043003#comment-17043003
 ] 

Lyor Goldstein commented on SSHD-968:
-

I am afraid I don't have good news - I have examined the code in the hopes that 
we can somehow expose the sequence number of the sent message. While it is 
technically possible it poses many challenges especially to the encode/decode 
loops - which are at the very heart of the packets management mechanism. I am 
not sure the benefit is worth the risk at this time...

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-23 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17043001#comment-17043001
 ] 

Lyor Goldstein commented on SSHD-968:
-

{quote}
This is true, but the server is netopeer-server, used by a lot of people, 
replying with "sorry this is a server issue", is not an option for us. Further, 
the bug is not in netopeer itself, but in libssh, which is one of the most 
common ssh libraries for linux (openssh works just fine though). I must assume 
this is fixed in the latest release, but I suppose there are thousands of 
servers out there not yet upgraded.
{quote}
I understand and empathize - but our R&D resources are extremely scarce - so we 
have to invest them where the vast majority of users are, I am not sure how 
many "used by a lot of people" is in this case since this is the 1st time we 
encountered this request. Perhaps in a specific niche netopeer-server is very 
popular, but in the server world OpenSSH is most widely used, and we interact 
with it smoothly.

{quote}
One of your comments is lost now, but knowing what message returning 
SSH_MSG_UNIMPLEMENTED can be done using the message ID. The 
SSH_MSG_UNIMPLEMENTED will return the message ID for the message it sent 
SSH_MSG_UNIMPLEMENTED for.
{quote}
Seems an avenue for a fix, but it's not as simple as that since the sent 
message ID of the {{SSH_MSG_GLOBAL_REQUEST}} is not exposed for the heartbeat 
code. Furthermore, some non-trivial tracking logic is required as well,

Bottom line - I will look into it (in the very little spare time I have) but I 
doubt very much that an easy/quick  solution is available. I know it's not 
much, but we welcome contributions and you are welcome to write a solution if 
you can afford the R&D effort. Let me warn you though that the code flow  is 
not trivial to follow - even for us who maintain it.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additiona

[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-23 Thread Patrik Ek (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17042997#comment-17042997
 ] 

Patrik Ek commented on SSHD-968:


[~lgoldstein] Sorry for replying late. Saturdays and Sundays are normally my 
days off, so I have not been that active. Hontestly I did not expect this fast 
response. Anyway, To answer your questions,

{color:#172b4d}1.{color}

_{color:#172b4d}Seems to me that servers that respond with 
{color}{{SSH_MSG_UNIMPLEMENTED}}{color:#172b4d} violate {color}[rfc4254 - 
section 4|https://tools.ietf.org/html/rfc4254#section-4]{color:#172b4d} that 
states that the response should be 
{color}{{SSH_MSG_REQUEST_FAILURE}}{color:#172b4d}.{color}_

This is true, but the server is netopeer-server, used by a lot of people, 
replying with "sorry this is a server issue", is not an option for us. Further, 
the bug is not in netopeer itself, but in libssh, which is one of the most 
common ssh libraries for linux (openssh works just fine though).

2.

One of your comments is lost now, but knowing what message returning 
SSH_MSG_UNIMPLEMENTED can be done using the message ID. The 
SSH_MSG_UNIMPLEMENTED will return the message ID for the message it sent 
SSH_MSG_UNIMPLEMENTED for.

3.

 

 _{color:#172b4d}Have you tried using the 
{color}[SSH_MSG_IGNORE|https://github.com/apache/mina-sshd/blob/master/docs/client-setup.md#keeping-the-session-alive-while-no-traffic]{color:#172b4d}
 mechanism instead of global requests{color}_ 

yes, but the problem is not to keep the connection alive. The problem is to 
know when the connection goes down. The proper way to do this is to send an 
SSH_MSG_GLOBAL_REQUEST with the want-reply flag. This is also how OpenSSH does. 
The differerence is that when you get the SSH_MSG_UNIMPLEMENTED flag in 
OpenSSH, it will instead count this as a valid reply, as this shows the server 
is alive and it is very obvious there will be no other reply.

BR
Patrik

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

--

[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-23 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17042993#comment-17042993
 ] 

Lyor Goldstein commented on SSHD-968:
-

Have you tried using the 
[SSH_MSG_IGNORE|https://github.com/apache/mina-sshd/blob/master/docs/client-setup.md#keeping-the-session-alive-while-no-traffic]
 mechanism instead of global requests ?

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Assignee: Lyor Goldstein
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org



[jira] [Commented] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED

2020-02-22 Thread Lyor Goldstein (Jira)


[ 
https://issues.apache.org/jira/browse/SSHD-968?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17042634#comment-17042634
 ] 

Lyor Goldstein commented on SSHD-968:
-

Seems to me that servers that respond with {{SSH_MSG_UNIMPLEMENTED}} violate 
[rfc4254 - section 4|https://tools.ietf.org/html/rfc4254#section-4] that states 
that the response should be {{SSH_MSG_REQUEST_FAILURE}}.

> SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied 
> with SSH_MSG_UNSUPPORTED
> --
>
> Key: SSHD-968
> URL: https://issues.apache.org/jira/browse/SSHD-968
> Project: MINA SSHD
>  Issue Type: Improvement
>Affects Versions: 2.3.0
> Environment: Windows 10
>Reporter: Patrik Ek
>Priority: Major
>
> In case SSH_MSG_GLOBAL_REQUEST is not supported by the remote SSH server, the 
> keep-alive heartbeat times out. The reason for this is SSH_MSG_UNIMPLEMENTED 
> is only logged in
> {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSession
> The method identifying the SSH_MSG_UNIMPLEMENTED is called 
> AbstractSession.doHandleMessage()
> The consequense is that no reply is received and the heartbeat times out 
> instead of calling AbstractSession.requestFailure(). Which in turn leads to 
> the session terminates.
> According to RFC 4253 sect. 11.4 
> ({color:#004000}https://tools.ietf.org/html/rfc4253#section-11.4{color}) the 
> SSH_MSG_UNIMPLEMENTED is meant to be ignored, but this makes little sense for 
> a heartbeat, as even SSH_MSG_UNIMPLEMENTED is good enough to count as a reply 
> for this. This is for example the case in OpenSSH, where 
> SSH_MSG_UNIMPLEMENTED replies for heartbeat, does not lead to a termination 
> of the SSH session.
> There is a workaround released in 2.1.1, to use 
> ReservedSessionMessagesHandler for handling replies, but this does not allow 
> access to the method AbstractSession.requestFailure() (without using 
> reflection so to say). Further, the heartbeat is ongoing in the background, 
> so there is no good solution to this problem from outside of the framework.
> https://issues.apache.org/jira/browse/SSHD-887?jql=project%20%3D%20SSHD%20AND%20fixVersion%20%3D%202.1.1
> Would this be possible to fix? The reason I write it here is because the bug 
> seems to existing up to some version of libssh, even for the SSHv2 protocol, 
> so just writing a bug report on the particular server will not solve the 
> problems for already existing implementations using libssh.
> The following config is used,
> SshClient client = 
> SshClient.setUpDefaultClient(){color:#cc7832};{color}{color:#808080}
> {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, 
> ClientFactoryManager.HEARTBEAT_INTERVAL, 15000);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REPLY_WAIT,
>  3);
>  
> PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBEAT_REQUEST,
>  "keepal...@openssh.com");{color}
> {color:#cc7832}{color:#172b4d}BR{color}
> {color:#172b4d}Patrik{color}
> {color}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@mina.apache.org
For additional commands, e-mail: dev-h...@mina.apache.org