You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@mina.apache.org by sebb <se...@gmail.com> on 2013/07/17 17:45:17 UTC

Re: [2/2] git commit: [SSHD-233] Provide better error messages instead of "Unable to negociate key exchange for item 2"

On 17 July 2013 16:02,  <gn...@apache.org> wrote:
> [SSHD-233] Provide better error messages instead of "Unable to negociate key exchange for item 2"
>
> Project: http://git-wip-us.apache.org/repos/asf/mina-sshd/repo
> Commit: http://git-wip-us.apache.org/repos/asf/mina-sshd/commit/0bc4246a
> Tree: http://git-wip-us.apache.org/repos/asf/mina-sshd/tree/0bc4246a
> Diff: http://git-wip-us.apache.org/repos/asf/mina-sshd/diff/0bc4246a
>
> Branch: refs/heads/master
> Commit: 0bc4246a4e41aa33d869e4a8ae01544eecd9bd62
> Parents: feb2464
> Author: Guillaume Nodet <gn...@apache.org>
> Authored: Wed Jul 17 16:59:02 2013 +0200
> Committer: Guillaume Nodet <gn...@apache.org>
> Committed: Wed Jul 17 16:59:02 2013 +0200
>
> ----------------------------------------------------------------------
>  .../apache/sshd/common/session/AbstractSession.java    | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> ----------------------------------------------------------------------
>
>
> http://git-wip-us.apache.org/repos/asf/mina-sshd/blob/0bc4246a/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java
> ----------------------------------------------------------------------
> diff --git a/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java b/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java
> index 2ba5532..a8c26b2 100644
> --- a/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java
> +++ b/sshd-core/src/main/java/org/apache/sshd/common/session/AbstractSession.java
> @@ -944,7 +944,18 @@ public abstract class AbstractSession implements Session {
>                  }
>              }
>              if (guess[i] == null && i != SshConstants.PROPOSAL_LANG_CTOS && i != SshConstants.PROPOSAL_LANG_STOC) {
> -                throw new IllegalStateException("Unable to negociate key exchange for item " + i);
> +                final String[] items = new String[] {
> +                    "kex algorithms",
> +                    "server host key algorithms",
> +                    "encryption algorithms (client to server)",
> +                    "encryption algorithms (server to client)",
> +                    "mac algorithms (client to server)",
> +                    "mac algorithms (server to client)",
> +                    "compression algorithms (client to server)",
> +                    "compression algorithms (server to client)"
> +                };

Surely those could be static strings?
What determines the order of the strings?
It ought to be documented.

> +                throw new IllegalStateException("Unable to negociate key exchange for " + items[i] +

Please fix this spelling mistake:

s/negociate /negotiate /


> +                        " (client: " + clientProposal[i] + " / server: " + serverProposal[i] + ")");
>              }
>          }
>          negociated = guess;
>