From dev-return-35981-apmail-mina-dev-archive=mina.apache.org@mina.apache.org Mon Feb 24 23:01:03 2020 Return-Path: X-Original-To: apmail-mina-dev-archive@www.apache.org Delivered-To: apmail-mina-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by minotaur.apache.org (Postfix) with SMTP id B1DBD1967C for ; Mon, 24 Feb 2020 23:01:03 +0000 (UTC) Received: (qmail 966 invoked by uid 500); 24 Feb 2020 23:01:03 -0000 Delivered-To: apmail-mina-dev-archive@mina.apache.org Received: (qmail 902 invoked by uid 500); 24 Feb 2020 23:01:02 -0000 Mailing-List: contact dev-help@mina.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@mina.apache.org Received: (qmail 887 invoked by uid 99); 24 Feb 2020 23:01:02 -0000 Received: from mailrelay1-us-west.apache.org (HELO mailrelay1-us-west.apache.org) (209.188.14.139) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 24 Feb 2020 23:01:02 +0000 Received: from jira-he-de.apache.org (static.172.67.40.188.clients.your-server.de [188.40.67.172]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id E14DEE30C1 for ; Mon, 24 Feb 2020 23:01:01 +0000 (UTC) Received: from jira-he-de.apache.org (localhost.localdomain [127.0.0.1]) by jira-he-de.apache.org (ASF Mail Server at jira-he-de.apache.org) with ESMTP id 1AC65780697 for ; Mon, 24 Feb 2020 23:01:01 +0000 (UTC) Date: Mon, 24 Feb 2020 23:01:01 +0000 (UTC) From: "Guillaume Nodet (Jira)" To: dev@mina.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (SSHD-968) SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is replied with SSH_MSG_UNSUPPORTED MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/SSHD-968?page=3Dcom.atlassian.= jira.plugin.system.issuetabpanels:all-tabpanel ] Guillaume Nodet reassigned SSHD-968: ------------------------------------ Assignee: Guillaume Nodet (was: Lyor Goldstein) > SshClient times out during keep-alive, when SSH_MSG_GLOBAL_REQUEST is rep= lied 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_UNIMPLE= MENTED is only logged in > {color:#172b4d}org.apache.sshd.common.session.helpers{color}.AbstractSess= ion > The method identifying the SSH_MSG_UNIMPLEMENTED is called AbstractSessio= n.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/h= tml/rfc4253#section-11.4{color}) the SSH_MSG_UNIMPLEMENTED is meant to be i= gnored, but this makes little sense for a heartbeat, as even SSH_MSG_UNIMPL= EMENTED is good enough to count as a reply for this. This is for example th= e 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=C2=A0ReservedSessionMessa= gesHandler for handling replies, but this does not allow access to the meth= od AbstractSession.requestFailure() (without using reflection so to say). F= urther, the heartbeat is ongoing in the background, so there is no good sol= ution to this problem from outside of the framework. > https://issues.apache.org/jira/browse/SSHD-887?jql=3Dproject%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 prot= ocol, 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 =3D SshClient.setUpDefaultClient(){color:#cc7832};{color= }{color:#808080} > {color} {color:#172b4d}PropertyResolverUtils.updateProperty(client, Clien= tFactoryManager.HEARTBEAT_INTERVAL, 15000); > PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBE= AT_REPLY_WAIT, 30000); > PropertyResolverUtils.updateProperty(client,ClientFactoryManager.HEARTBE= AT_REQUEST, "keepalive@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-unsubscribe@mina.apache.org For additional commands, e-mail: dev-help@mina.apache.org