[jira] [Updated] (SSHD-1276) Add support for to merged output and error streams of remote process

2022-07-06 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein updated SSHD-1276:
-
Summary: Add support for to merged output and error streams of remote 
process  (was: How to merge output and error streams of remote process ?)

> Add support for to merged output and error streams of remote process
> 
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: New Feature
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Priority: Minor
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Work started] (SSHD-1276) Add support for merged inverted output and error streams of remote process

2022-07-06 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Work on SSHD-1276 started by Lyor Goldstein.

> Add support for merged inverted output and error streams of remote process
> --
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: New Feature
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Assignee: Lyor Goldstein
>Priority: Minor
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Assigned] (SSHD-1276) Add support for merged inverted output and error streams of remote process

2022-07-06 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein reassigned SSHD-1276:


Assignee: Lyor Goldstein

> Add support for merged inverted output and error streams of remote process
> --
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: New Feature
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Assignee: Lyor Goldstein
>Priority: Minor
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Comment Edited] (SSHD-1276) Add support for merged inverted output and error streams of remote process

2022-07-06 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein edited comment on SSHD-1276 at 7/7/22 5:13 AM:
--

You seem to want to read from the combined stream while the command is being 
executed - that is why I assume you are using the inverted streams. This is not 
possible due to various reasons. I recommend using the 1st option combined with 
a {{PipedOutputStream}}:
{code:java}
PipedInputStream mergedInput = new PipedInputStream()
PipedOutputStream mergedOutputStream = new PipedOutputStream(mergedInput);
channelExec.setOut(mergedOutputStream);
channelExec.setErr(mergedOutputStream);
channelExec.open.verify();

...read from mergedInput...
{code}

However, it is much more complicated than this - you need to make sure that you 
start reading from the input stream +before+ opening the channel otherwise the 
"pump" thread might block - and that means spawning a thread and killing it 
once execution is done or there is an exception. Moreover, you need to make 
sure that the data from the STDOUT does not intermingle with that of STDERR 
since they may originate from different threads.

This is doable - up to you. However, if all you want is to run a command and 
then examine its output afterwards I suggest you look into the 
{{ClientSession#executeRemoteCommand}} method.

I have converted this into a new feature - perhaps we might get to it some day




was (Author: lgoldstein):
You seem to want to read from the combined stream while the command is being 
executed - that is why I assume you are using the inverted streams. This is not 
possible due to various reasons. I recommend using the 1st option combined with 
a {{PipedOutputStream}}:
{code:java}
PipedInputStream mergedInput = new PipedInputStream()
PipedOutputStream mergedOutputStream = new PipedOutputStream(mergedInput);
channelExec.setOut(mergedOutputStream);
channelExec.setErr(mergedOutputStream);
channelExec.open.verify();

...read from mergedInput...
{code}

However, it is much more complicated than this - you need to make sure that you 
start reading from the input stream +before+ opening the channel otherwise the 
"pump" thread might block - and that means spawning a thread and killing it 
once execution is done or there is an exception. Moreover, you need to make 
sure that the data from the STDOUT does not intermingle with that of STDERR 
since they may originate from different threads.

This is doable - up to you. However, if all you want is to run a command and 
then examine its output afterwards I suggest you look into the 
{{ClientSession#executeRemoteCommand}} method



> Add support for merged inverted output and error streams of remote process
> --
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: New Feature
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Priority: Minor
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Updated] (SSHD-1276) Add support for merged inverted output and error streams of remote process

2022-07-06 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein updated SSHD-1276:
-
Summary: Add support for merged inverted output and error streams of remote 
process  (was: Add support for to merged output and error streams of remote 
process)

> Add support for merged inverted output and error streams of remote process
> --
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: New Feature
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Priority: Minor
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Comment Edited] (SSHD-1276) How to merge output and error streams of remote process ?

2022-07-06 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein edited comment on SSHD-1276 at 7/7/22 5:11 AM:
--

You seem to want to read from the combined stream while the command is being 
executed - that is why I assume you are using the inverted streams. This is not 
possible due to various reasons. I recommend using the 1st option combined with 
a {{PipedOutputStream}}:
{code:java}
PipedInputStream mergedInput = new PipedInputStream()
PipedOutputStream mergedOutputStream = new PipedOutputStream(mergedInput);
channelExec.setOut(mergedOutputStream);
channelExec.setErr(mergedOutputStream);
channelExec.open.verify();

...read from mergedInput...
{code}

However, it is much more complicated than this - you need to make sure that you 
start reading from the input stream +before+ opening the channel otherwise the 
"pump" thread might block - and that means spawning a thread and killing it 
once execution is done or there is an exception. Moreover, you need to make 
sure that the data from the STDOUT does not intermingle with that of STDERR 
since they may originate from different threads.

This is doable - up to you. However, if all you want is to run a command and 
then examine its output afterwards I suggest you look into the 
{{ClientSession#executeRemoteCommand}} method




was (Author: lgoldstein):
You seem to want to read from the combined stream while the command is being 
executed - that is why I assume you are using the inverted streams. This is not 
possible due to various reasons. I recommend using the 1st option combined with 
a {{PipedOutputStream}}:
{code:java}
PipedInputStream mergedInput = new PipedInputStream()
PipedOutputStream mergedOutputStream = new PipedOutputStream(mergedInput);
channelExec.setOut(mergedOutputStream);
channelExec.setErr(mergedOutputStream);
channelExec.open.verify();

...read from mergedInput...
{code}

However, it is much more complicated than this - you need to make sure that you 
start reading from the input stream +before+ opening the channel otherwise the 
"pump" thread might block - and that means spawning a thread and killing it 
once execution is done or there is an exception. This is doable - up to you. 
However, if all you want is to run a command and then examine its output 
afterwards I suggest you look into the {{ClientSession#executeRemoteCommand}} 
method



> How to merge output and error streams of remote process ?
> -
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Priority: Major
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Updated] (SSHD-1276) How to merge output and error streams of remote process ?

2022-07-06 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein updated SSHD-1276:
-
Issue Type: New Feature  (was: Question)

> How to merge output and error streams of remote process ?
> -
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: New Feature
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Priority: Major
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Updated] (SSHD-1276) How to merge output and error streams of remote process ?

2022-07-06 Thread Lyor Goldstein (Jira)


 [ 
https://issues.apache.org/jira/browse/SSHD-1276?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lyor Goldstein updated SSHD-1276:
-
Priority: Minor  (was: Major)

> How to merge output and error streams of remote process ?
> -
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: New Feature
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Priority: Minor
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (SSHD-1276) How to merge output and error streams of remote process ?

2022-07-06 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein commented on SSHD-1276:
--

You seem to want to read from the combined stream while the command is being 
executed - that is why I assume you are using the inverted streams. This is not 
possible due to various reasons. I recommend using the 1st option combined with 
a {{PipedOutputStream}}:
{code:java}
PipedInputStream mergedInput = new PipedInputStream()
PipedOutputStream mergedOutputStream = new PipedOutputStream(mergedInput);
channelExec.setOut(mergedOutputStream);
channelExec.setErr(mergedOutputStream);
channelExec.open.verify();

...read from mergedInput...
{code}

However, it is much more complicated than this - you need to make sure that you 
start reading from the input stream +before+ opening the channel otherwise the 
"pump" thread might block - and that means spawning a thread and killing it 
once execution is done or there is an exception. This is doable - up to you. 
However, if all you want is to run a command and then examine its output 
afterwards I suggest you look into the {{ClientSession#executeRemoteCommand}} 
method



> How to merge output and error streams of remote process ?
> -
>
> Key: SSHD-1276
> URL: https://issues.apache.org/jira/browse/SSHD-1276
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Priority: Major
>
> Hello!
> I want to merge output and error streams of remote process as 
> {{java.lang.ProcessBuilder#redirectErrorStream(true)}} does.
> If I set output and error streams;
> {quote}channelExec.setOut(mergedOutputStream);
> channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return {{{}null{}}}.
> If I don't set output and error streams;
> {quote}//channelExec.setOut(mergedOutputStream);
> //channelExec.setErr(mergedOutputStream);
> channelExec.open.verify();
> {quote}
> Then, {{ChannelExec#getInvertedOut()}} and {{ChannelExec#getInvertedErr()}} 
> return not {{{}null{}}}. But, streams are not merged.
> How can I merge output and error streams of remote process ?
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



Re: Exception in filter (was: Re: [Vote] MINA 2.2.0 release)

2022-07-06 Thread Christoph John
Hi
You could see the failing tests here: 
https://github.com/quickfix-j/quickfixj/runs/7201285514?check_suite_focus=true
Basically these are tests that should fail when using a bad certificate.
As an example here is one test that registers a filter that should get an 
exception but it doesn't: 
https://github.com/quickfix-j/quickfixj/blob/da21d92c32c37265ee1d4e20519832fb13a26d05/quickfixj-core/src/test/java/quickfix/mina/ssl/SecureSocketTest.java#L67

Thanks in advance and cheers
Chris

Jul 6, 2022 12:42:15 Jonathan Valliere :

> What test are you trying?  Emmanuel made changes from the original design
> to cause it to throw on the filter.  My original design threw on the filter
> but only during a subsequent read or write action thereby enforcing strong
> concurrency within the pipeline.
> 
> On Jul 6, 2022 at 3:53:57 AM, Christoph John
>  wrote:
> 
>> Ok, the tests in QuickFIX/J which expect the exception to be caught in a
>> filter still don't work.
>> I recall that you also did some changes in other Apache projects to make
>> it work with MINA 2.2.0. Could it be that I also need to adapt something in
>> this regard?
>> 
>> Thanks
>> Chris
>> 
>> Jul 5, 2022 18:47:09 Emmanuel Lécharny :
>> 
>> I have tested that the exception gets propagated before launching the vote
>> to be clear :-)
>> 
>> 
>> On 05/07/2022 18:17, Christoph John wrote:
>> 
>>> Sorry, no. The last message regarding this was:
>> 
>>> 
>> 
>>> --snip-
>> 
>>> 
>> 
>>> 11.04.2022 09:37:30 Emmanuel Lécharny :
>> 
>>> Hi Christophe,
>> 
>>> sorry, my late mail was off base.
>> 
>>> The pb here is that the SSLEngine excpeiton is not propagated to the
>> handler, when it should.
>> 
>>> My guess is that we have some missing call somewhere in the stack. I'm
>> going to check that out.
>> 
>>> On 11/04/2022 00:15, Christoph John wrote:
>> 
 Hi,
>> 
 thanks Jonathan and Emmanuel for working on this!
>> 
 I tried to integrate this into QuickFIX/J and it compiles successfully.
>> However there are some tests failing that expect an Exception. For example
>> we have
>> 
 
>> https://github.com/quickfix-j/quickfixj/blob/b6a822a46a5278dcd0985a5a77299ed03168ab03/quickfixj-core/src/test/java/quickfix/mina/ssl/SecureSocketTest.java#L54
>> 
 Up to now it was tried to get the Exception via a filter in the chain.
>> This no longer seems to work but I think I can see the error getting thrown
>> in the log:
>> 
 SEVERE: SSLHandlerG0@590ec99c[mode=server, connected=false] task() -
>> storing error {}
>> 
 javax.net.ssl.SSLHandshakeException: No available authentication scheme
>> 
     at
>> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
>> 
     at
>> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
>> 
     at
>> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:358)
>> 
     at
>> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
>> 
     at
>> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:305)
>> 
     at
>> java.base/sun.security.ssl.CertificateMessage$T13CertificateProducer.onProduceCertificate(CertificateMessage.java:972)
>> 
     at
>> java.base/sun.security.ssl.CertificateMessage$T13CertificateProducer.produce(CertificateMessage.java:961)
>> 
     at
>> java.base/sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:440)
>> 
     at
>> java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.goServerHello(ClientHello.java:1246)
>> 
     at
>> java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.consume(ClientHello.java:1182)
>> 
     at
>> java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.onClientHello(ClientHello.java:840)
>> 
     at
>> java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.consume(ClientHello.java:801)
>> 
     at
>> java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
>> 
     at
>> java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
>> 
     at
>> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1277)
>> 
     at
>> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1264)
>> 
     at
>> java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
>> 
     at
>> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1209)
>> 
     at
>> org.apache.mina.filter.ssl.SSLHandlerG0.execute_task(SSLHandlerG0.java:743)
>> 
     at
>> org.apache.mina.filter.ssl.SSLHandlerG0.receive_loop(SSLHandlerG0.java:255)
>> 
     at
>> org.apache.mina.filter.ssl.SSLHandlerG0.receive(SSLHandlerG0.java:162)
>> 
     at
>> org.apache.mina.filter.ssl.SslFilter.messageReceived(SslFilter.java:342)
>> 
     at
>> 

[GitHub] [mina-vysper] dependabot[bot] opened a new pull request, #23: Bump jackrabbit-core from 1.5.3 to 2.1.0

2022-07-06 Thread GitBox


dependabot[bot] opened a new pull request, #23:
URL: https://github.com/apache/mina-vysper/pull/23

   Bumps jackrabbit-core from 1.5.3 to 2.1.0.
   
   
   [![Dependabot compatibility 
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=org.apache.jackrabbit:jackrabbit-core=maven=1.5.3=2.1.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)
   
   Dependabot will resolve any conflicts with this PR as long as you don't 
alter it yourself. You can also trigger a rebase manually by commenting 
`@dependabot rebase`.
   
   [//]: # (dependabot-automerge-start)
   [//]: # (dependabot-automerge-end)
   
   ---
   
   
   Dependabot commands and options
   
   
   You can trigger Dependabot actions by commenting on this PR:
   - `@dependabot rebase` will rebase this PR
   - `@dependabot recreate` will recreate this PR, overwriting any edits that 
have been made to it
   - `@dependabot merge` will merge this PR after your CI passes on it
   - `@dependabot squash and merge` will squash and merge this PR after your CI 
passes on it
   - `@dependabot cancel merge` will cancel a previously requested merge and 
block automerging
   - `@dependabot reopen` will reopen this PR if it is closed
   - `@dependabot close` will close this PR and stop Dependabot recreating it. 
You can achieve the same result by closing it manually
   - `@dependabot ignore this major version` will close this PR and stop 
Dependabot creating any more for this major version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this minor version` will close this PR and stop 
Dependabot creating any more for this minor version (unless you reopen the PR 
or upgrade to it yourself)
   - `@dependabot ignore this dependency` will close this PR and stop 
Dependabot creating any more for this dependency (unless you reopen the PR or 
upgrade to it yourself)
   - `@dependabot use these labels` will set the current labels as the default 
for future PRs for this repo and language
   - `@dependabot use these reviewers` will set the current reviewers as the 
default for future PRs for this repo and language
   - `@dependabot use these assignees` will set the current assignees as the 
default for future PRs for this repo and language
   - `@dependabot use this milestone` will set the current milestone as the 
default for future PRs for this repo and language
   
   You can disable automated security fix PRs for this repo from the [Security 
Alerts page](https://github.com/apache/mina-vysper/network/alerts).
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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



[jira] [Commented] (SSHD-1275) Remote process is still available after ChannelExec.close(true).awaitUninterruptibly()

2022-07-06 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein commented on SSHD-1275:
--

As far as I can tell this behavior is consistent with the RFC (expected is a 
value judgement...) - if the remote process dies before sending "exit-status" 
packet or never sends it altogether then it is compliant - to quote [rfc4253 
section-6.10|https://datatracker.ietf.org/doc/html/rfc4254#section-6.10]
{quote}
When the command running at the other end terminates, the following message can 
be sent to return the exit status of the command.  Returning the status is 
RECOMMENDED.
{quote}

RECOMMENDED but not MANDATORY...

> Remote process is still available after 
> ChannelExec.close(true).awaitUninterruptibly()
> --
>
> Key: SSHD-1275
> URL: https://issues.apache.org/jira/browse/SSHD-1275
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.8.0
> Environment: Java SE 8, Apache NetBeans IDE 8.2
>Reporter: dgü
>Priority: Major
>
> Hello!
> If I close channel immediately by 
> {{{}org.apache.sshd.client.channel.ChannelExec.close(true).awaitUninterruptibly(){}}},
>  the remote process is not terminated and 
> {{org.apache.sshd.client.channel.ChannelExec#getExitStatus()}} returns 
> {{{}null{}}}.
> Even if I test with _Thread.sleep(60*1000)_ after channel close, the problem 
> still happens. The problem doesn't happen when channel is closed gracefully.
> is this expected behaviour ?
>  
> Thanks in advance!



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (SSHD-1274) UserInteraction Problem

2022-07-06 Thread Lyor Goldstein (Jira)


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

Lyor Goldstein commented on SSHD-1274:
--

{{UserInteraction}} has to do with "keyboard-interactive" as described in 
[rfc4256|
https://datatracker.ietf.org/doc/html/rfc4256]. The MINA SSHD code makes a best 
effort to +guess+ that the server is asking for a password - however, it might 
not be able to - as seems to be the case here. I strongly recommend reading the 
RFC and then provide your own implementation for 
{{UserInteraction#interactive}} challenges and responses handling for this 
specific server.

> UserInteraction Problem
> ---
>
> Key: SSHD-1274
> URL: https://issues.apache.org/jira/browse/SSHD-1274
> Project: MINA SSHD
>  Issue Type: Question
>Affects Versions: 2.8.0
>Reporter: Cheung
>Priority: Major
> Fix For: 2.8.0
>
>
> I used the sshd client。 I need to change my password when I logged in for the 
> first time,the interaction is success in xshell。There are three complete 
> interactions:
> 1.Enter a new password
> 2.Confirm new password
> 3.connected and enter the service
> But when i use sshd clent, i just can received first time interactive from 
> service。i use the 
> org.apache.sshd.client.auth.keyboard.UserInteraction#interactive to received 
> prompt from service。The clientSession connect is success,but authFure done is 
> false and the opeFuture of shellChannel is false。
> I try to read byte of passowrd to shellChannel‘s inputStream,it's not work。
> How can i send the newPassword to service and received interactive from 
> service after first time。
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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



[jira] [Commented] (SSHD-1277) Error connecting to particular SFTP server after enabling HostKeyAlgorithms rsa-sha2-256 rsa-sha2-512 on SFTP client

2022-07-06 Thread Roberto Deandrea (Jira)


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

Roberto Deandrea commented on SSHD-1277:


Thomas, thank you for your fast explanation.

>>The client send in SSH_MSG_KEX_INIT the supported host key signature 
>>algorithms "ssh-rsa, ssh-dss,rsa-sha2-256,rsa-sha2-512". (Where does ssh-dss 
>>come from? From the >>code you've shown, it shouldn't be in there, should it? 
>>But that's irrelevant.)

I forgot to add ssh-dss i  my code fragment, but as you said it's not relevant.

 
>>Specify the signature algorithms in the client in the order 
>>"rsa-sha2-512,rsa-sha2-256,ssh-rsa". Then client and server should both agree 
>>on the same signature algorithm, and >>the connection should work again.
 
I will try your code change suggestion and let you know what happened.
 
Thank you very much for your great support!
Roberto

> Error connecting to particular SFTP server after enabling HostKeyAlgorithms 
> rsa-sha2-256 rsa-sha2-512 on SFTP client
> 
>
> Key: SSHD-1277
> URL: https://issues.apache.org/jira/browse/SSHD-1277
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.8.0
> Environment: java.runtime = Java(TM) SE Runtime Environment (8.0.6.10 
> - pxa6480sr6fp10-20200408_01(SR6 FP10))
> os = Linux (3.10.0-1160.42.2.el7.x86_64; amd64) (en_US)
>Reporter: Roberto Deandrea
>Priority: Major
> Attachments: trace_apachesshd_client.log
>
>
> Hi Thomas,
> I have a strange issue with an SFTP client connection based on Apache SSHD 
> 2.8.0 client.
> After enabling the support for server HostKeyAlgorithms 
> rsa-sha2-256,rsa-sha2-512 with this code:
> _SshClient sshClient = SshClient.setUpDefaultClient();_ 
>  _sshClient.setSignatureFactories(Arrays.> asList( 
> BuiltinSignatures.rsa,_ 
> _BuiltinSignatures.rsaSHA256,_ 
> _BuiltinSignatures.rsaSHA512));_
>  
> the SFTP connection fails against a particular server with the following 
> stack trace :
> [6/28/22 5:32:46:783 EDT] 4102 id= 
> org.apache.sshd.common.util.logging.LoggingUtils             W warn 
> exceptionCaught(ClientSessionImpl[StateStreetDS.sftpuser@/127.0.0.1:46323])[state=Opened]
>  SignatureException: Signature encoding error
> java.security.SignatureException: Signature encoding error
>         at com.ibm.crypto.fips.provider.RSASignature.a(Unknown Source)
>         at com.ibm.crypto.fips.provider.RSASignature.engineVerify(Unknown 
> Source)
>         at java.security.Signature$Delegate.engineVerify(Signature.java:1231)
>         at java.security.Signature.verify(Signature.java:661)
>         at 
> org.apache.sshd.common.signature.AbstractSignature.doVerify(AbstractSignature.java:164)
>         at 
> org.apache.sshd.common.signature.SignatureRSA.verify(SignatureRSA.java:116)
>         at org.apache.sshd.client.kex.DHGClient.next(DHGClient.java:181)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.handleKexMessage(AbstractSession.java:633)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:524)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:452)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1524)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:412)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64)
>         at 
> org.apache.sshd.netty.NettyIoSession.channelRead(NettyIoSession.java:252)
>         at 
> org.apache.sshd.netty.NettyIoSession$Adapter.channelRead(NettyIoSession.java:296)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
>         at 
> io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
>         at 
> io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
>         at 
> 

[jira] [Commented] (SSHD-1277) Error connecting to particular SFTP server after enabling HostKeyAlgorithms rsa-sha2-256 rsa-sha2-512 on SFTP client

2022-07-06 Thread Thomas Wolf (Jira)


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

Thomas Wolf commented on SSHD-1277:
---

The client send in SSH_MSG_KEX_INIT the supported host key signature algorithms 
"ssh-rsa, ssh-dss,rsa-sha2-256,rsa-sha2-512". (Where does ssh-dss come from? 
From the code you've shown, it shouldn't be in there, should it? But that's 
irrelevant.)

The server in its own SSH_MSG_KEX_INIT sends 
"ecdsa-sha2-nistp256,rsa-sha2-512,rsa-sha2-256,ssh-rsa".

According to [RFC 
4253|https://datatracker.ietf.org/doc/html/rfc4253#section-7.1], negotiation of 
the server host key algorithms, "The first algorithm on the client's name-list 
that satisfies the requirements and is also supported by the server MUST be 
chosen".

Apache MINA sshd chooses "ssh-rsa". The server apparently chooses 
"rsa-sha2-256". So the two don't understand each other.

I've seen this [before|https://www.eclipse.org/forums/index.php/t/1108282/]. I 
have the impression "ssh-rsa" would be correct, and the server is wrong to send 
an "rsa-sha2-256" signature. (I.e., no bug in Apache MINA sshd. But maybe I'm 
missing something... KEX algorithm is "ecdh-sha2-nistp256".)

Specify the signature algorithms in the client in the order 
"rsa-sha2-512,rsa-sha2-256,ssh-rsa". Then client and server should both agree 
on the same signature algorithm, and the connection should work again.

> Error connecting to particular SFTP server after enabling HostKeyAlgorithms 
> rsa-sha2-256 rsa-sha2-512 on SFTP client
> 
>
> Key: SSHD-1277
> URL: https://issues.apache.org/jira/browse/SSHD-1277
> Project: MINA SSHD
>  Issue Type: Bug
>Affects Versions: 2.8.0
> Environment: java.runtime = Java(TM) SE Runtime Environment (8.0.6.10 
> - pxa6480sr6fp10-20200408_01(SR6 FP10))
> os = Linux (3.10.0-1160.42.2.el7.x86_64; amd64) (en_US)
>Reporter: Roberto Deandrea
>Priority: Major
> Attachments: trace_apachesshd_client.log
>
>
> Hi Thomas,
> I have a strange issue with an SFTP client connection based on Apache SSHD 
> 2.8.0 client.
> After enabling the support for server HostKeyAlgorithms 
> rsa-sha2-256,rsa-sha2-512 with this code:
> _SshClient sshClient = SshClient.setUpDefaultClient();_ 
>  _sshClient.setSignatureFactories(Arrays.> asList( 
> BuiltinSignatures.rsa,_ 
> _BuiltinSignatures.rsaSHA256,_ 
> _BuiltinSignatures.rsaSHA512));_
>  
> the SFTP connection fails against a particular server with the following 
> stack trace :
> [6/28/22 5:32:46:783 EDT] 4102 id= 
> org.apache.sshd.common.util.logging.LoggingUtils             W warn 
> exceptionCaught(ClientSessionImpl[StateStreetDS.sftpuser@/127.0.0.1:46323])[state=Opened]
>  SignatureException: Signature encoding error
> java.security.SignatureException: Signature encoding error
>         at com.ibm.crypto.fips.provider.RSASignature.a(Unknown Source)
>         at com.ibm.crypto.fips.provider.RSASignature.engineVerify(Unknown 
> Source)
>         at java.security.Signature$Delegate.engineVerify(Signature.java:1231)
>         at java.security.Signature.verify(Signature.java:661)
>         at 
> org.apache.sshd.common.signature.AbstractSignature.doVerify(AbstractSignature.java:164)
>         at 
> org.apache.sshd.common.signature.SignatureRSA.verify(SignatureRSA.java:116)
>         at org.apache.sshd.client.kex.DHGClient.next(DHGClient.java:181)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.handleKexMessage(AbstractSession.java:633)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:524)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:452)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1524)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:412)
>         at 
> org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64)
>         at 
> org.apache.sshd.netty.NettyIoSession.channelRead(NettyIoSession.java:252)
>         at 
> org.apache.sshd.netty.NettyIoSession$Adapter.channelRead(NettyIoSession.java:296)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
>         at 
> io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
>         at 
> io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271)
>         at 
> 

Re: Exception in filter (was: Re: [Vote] MINA 2.2.0 release)

2022-07-06 Thread Jonathan Valliere
 What test are you trying?  Emmanuel made changes from the original design
to cause it to throw on the filter.  My original design threw on the filter
but only during a subsequent read or write action thereby enforcing strong
concurrency within the pipeline.

On Jul 6, 2022 at 3:53:57 AM, Christoph John
 wrote:

> Ok, the tests in QuickFIX/J which expect the exception to be caught in a
> filter still don't work.
> I recall that you also did some changes in other Apache projects to make
> it work with MINA 2.2.0. Could it be that I also need to adapt something in
> this regard?
>
> Thanks
> Chris
>
> Jul 5, 2022 18:47:09 Emmanuel Lécharny :
>
> I have tested that the exception gets propagated before launching the vote
> to be clear :-)
>
>
> On 05/07/2022 18:17, Christoph John wrote:
>
> > Sorry, no. The last message regarding this was:
>
> >
>
> > --snip-
>
> >
>
> > 11.04.2022 09:37:30 Emmanuel Lécharny :
>
> > Hi Christophe,
>
> > sorry, my late mail was off base.
>
> > The pb here is that the SSLEngine excpeiton is not propagated to the
> handler, when it should.
>
> > My guess is that we have some missing call somewhere in the stack. I'm
> going to check that out.
>
> > On 11/04/2022 00:15, Christoph John wrote:
>
> >> Hi,
>
> >> thanks Jonathan and Emmanuel for working on this!
>
> >> I tried to integrate this into QuickFIX/J and it compiles successfully.
> However there are some tests failing that expect an Exception. For example
> we have
>
> >>
> https://github.com/quickfix-j/quickfixj/blob/b6a822a46a5278dcd0985a5a77299ed03168ab03/quickfixj-core/src/test/java/quickfix/mina/ssl/SecureSocketTest.java#L54
>
> >> Up to now it was tried to get the Exception via a filter in the chain.
> This no longer seems to work but I think I can see the error getting thrown
> in the log:
>
> >> SEVERE: SSLHandlerG0@590ec99c[mode=server, connected=false] task() -
> storing error {}
>
> >> javax.net.ssl.SSLHandshakeException: No available authentication scheme
>
> >> at
> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
>
> >> at
> java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
>
> >> at
> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:358)
>
> >> at
> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
>
> >> at
> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:305)
>
> >> at
> java.base/sun.security.ssl.CertificateMessage$T13CertificateProducer.onProduceCertificate(CertificateMessage.java:972)
>
> >> at
> java.base/sun.security.ssl.CertificateMessage$T13CertificateProducer.produce(CertificateMessage.java:961)
>
> >> at
> java.base/sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:440)
>
> >> at
> java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.goServerHello(ClientHello.java:1246)
>
> >> at
> java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.consume(ClientHello.java:1182)
>
> >> at
> java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.onClientHello(ClientHello.java:840)
>
> >> at
> java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.consume(ClientHello.java:801)
>
> >> at
> java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
>
> >> at
> java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
>
> >> at
> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1277)
>
> >> at
> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1264)
>
> >> at
> java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
>
> >> at
> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1209)
>
> >> at
> org.apache.mina.filter.ssl.SSLHandlerG0.execute_task(SSLHandlerG0.java:743)
>
> >> at
> org.apache.mina.filter.ssl.SSLHandlerG0.receive_loop(SSLHandlerG0.java:255)
>
> >> at
> org.apache.mina.filter.ssl.SSLHandlerG0.receive(SSLHandlerG0.java:162)
>
> >> at
> org.apache.mina.filter.ssl.SslFilter.messageReceived(SslFilter.java:342)
>
> >> at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650)
>
> >> at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49)
>
> >> at
> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128)
>
> >> at
> org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:122)
>
> >> at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650)
>
> >> at
> org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:643)
>
> >> at
> 

[jira] [Created] (SSHD-1277) Error connecting to particular SFTP server after enabling HostKeyAlgorithms rsa-sha2-256 rsa-sha2-512 on SFTP client

2022-07-06 Thread Roberto Deandrea (Jira)
Roberto Deandrea created SSHD-1277:
--

 Summary: Error connecting to particular SFTP server after enabling 
HostKeyAlgorithms rsa-sha2-256 rsa-sha2-512 on SFTP client
 Key: SSHD-1277
 URL: https://issues.apache.org/jira/browse/SSHD-1277
 Project: MINA SSHD
  Issue Type: Bug
Affects Versions: 2.8.0
 Environment: java.runtime = Java(TM) SE Runtime Environment (8.0.6.10 
- pxa6480sr6fp10-20200408_01(SR6 FP10))
os = Linux (3.10.0-1160.42.2.el7.x86_64; amd64) (en_US)

Reporter: Roberto Deandrea
 Attachments: trace_apachesshd_client.log

Hi Thomas,

I have a strange issue with an SFTP client connection based on Apache SSHD 
2.8.0 client.

After enabling the support for server HostKeyAlgorithms 
rsa-sha2-256,rsa-sha2-512 with this code:

_SshClient sshClient = SshClient.setUpDefaultClient();_ 

 _sshClient.setSignatureFactories(Arrays.> asList( 
BuiltinSignatures.rsa,_ 

_BuiltinSignatures.rsaSHA256,_ 

_BuiltinSignatures.rsaSHA512));_

 

the SFTP connection fails against a particular server with the following stack 
trace :

[6/28/22 5:32:46:783 EDT] 4102 id= 
org.apache.sshd.common.util.logging.LoggingUtils             W warn 
exceptionCaught(ClientSessionImpl[StateStreetDS.sftpuser@/127.0.0.1:46323])[state=Opened]
 SignatureException: Signature encoding error
java.security.SignatureException: Signature encoding error
        at com.ibm.crypto.fips.provider.RSASignature.a(Unknown Source)
        at com.ibm.crypto.fips.provider.RSASignature.engineVerify(Unknown 
Source)
        at java.security.Signature$Delegate.engineVerify(Signature.java:1231)
        at java.security.Signature.verify(Signature.java:661)
        at 
org.apache.sshd.common.signature.AbstractSignature.doVerify(AbstractSignature.java:164)
        at 
org.apache.sshd.common.signature.SignatureRSA.verify(SignatureRSA.java:116)
        at org.apache.sshd.client.kex.DHGClient.next(DHGClient.java:181)
        at 
org.apache.sshd.common.session.helpers.AbstractSession.handleKexMessage(AbstractSession.java:633)
        at 
org.apache.sshd.common.session.helpers.AbstractSession.doHandleMessage(AbstractSession.java:524)
        at 
org.apache.sshd.common.session.helpers.AbstractSession.handleMessage(AbstractSession.java:452)
        at 
org.apache.sshd.common.session.helpers.AbstractSession.decode(AbstractSession.java:1524)
        at 
org.apache.sshd.common.session.helpers.AbstractSession.messageReceived(AbstractSession.java:412)
        at 
org.apache.sshd.common.session.helpers.AbstractSessionIoHandler.messageReceived(AbstractSessionIoHandler.java:64)
        at 
org.apache.sshd.netty.NettyIoSession.channelRead(NettyIoSession.java:252)
        at 
org.apache.sshd.netty.NettyIoSession$Adapter.channelRead(NettyIoSession.java:296)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
        at 
io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
        at 
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
        at 
io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
        at 
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
        at 
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
        at 
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:719)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:655)
        at 
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:581)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
        at 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
        at 
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.lang.Thread.run(Thread.java:820)
Caused by: java.io.IOException: ObjectIdentifier mismatch: 
2.16.840.1.101.3.4.2.1
        at 

Exception in filter (was: Re: [Vote] MINA 2.2.0 release)

2022-07-06 Thread Christoph John
Ok, the tests in QuickFIX/J which expect the exception to be caught in a filter 
still don't work.
I recall that you also did some changes in other Apache projects to make it 
work with MINA 2.2.0. Could it be that I also need to adapt something in this 
regard?

Thanks
Chris

Jul 5, 2022 18:47:09 Emmanuel Lécharny :

> I have tested that the exception gets propagated before launching the vote to 
> be clear :-)
> 
> On 05/07/2022 18:17, Christoph John wrote:
>> Sorry, no. The last message regarding this was:
>> 
>> --snip-
>> 
>> 11.04.2022 09:37:30 Emmanuel Lécharny :
>> Hi Christophe,
>> sorry, my late mail was off base.
>> The pb here is that the SSLEngine excpeiton is not propagated to the 
>> handler, when it should.
>> My guess is that we have some missing call somewhere in the stack. I'm going 
>> to check that out.
>> On 11/04/2022 00:15, Christoph John wrote:
>>> Hi,
>>> thanks Jonathan and Emmanuel for working on this!
>>> I tried to integrate this into QuickFIX/J and it compiles successfully. 
>>> However there are some tests failing that expect an Exception. For example 
>>> we have
>>> https://github.com/quickfix-j/quickfixj/blob/b6a822a46a5278dcd0985a5a77299ed03168ab03/quickfixj-core/src/test/java/quickfix/mina/ssl/SecureSocketTest.java#L54
>>> Up to now it was tried to get the Exception via a filter in the chain. This 
>>> no longer seems to work but I think I can see the error getting thrown in 
>>> the log:
>>> SEVERE: SSLHandlerG0@590ec99c[mode=server, connected=false] task() - 
>>> storing error {}
>>> javax.net.ssl.SSLHandshakeException: No available authentication scheme
>>>     at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:131)
>>>     at java.base/sun.security.ssl.Alert.createSSLException(Alert.java:117)
>>>     at 
>>> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:358)
>>>     at 
>>> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:314)
>>>     at 
>>> java.base/sun.security.ssl.TransportContext.fatal(TransportContext.java:305)
>>>     at 
>>> java.base/sun.security.ssl.CertificateMessage$T13CertificateProducer.onProduceCertificate(CertificateMessage.java:972)
>>>     at 
>>> java.base/sun.security.ssl.CertificateMessage$T13CertificateProducer.produce(CertificateMessage.java:961)
>>>     at 
>>> java.base/sun.security.ssl.SSLHandshake.produce(SSLHandshake.java:440)
>>>     at 
>>> java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.goServerHello(ClientHello.java:1246)
>>>     at 
>>> java.base/sun.security.ssl.ClientHello$T13ClientHelloConsumer.consume(ClientHello.java:1182)
>>>     at 
>>> java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.onClientHello(ClientHello.java:840)
>>>     at 
>>> java.base/sun.security.ssl.ClientHello$ClientHelloConsumer.consume(ClientHello.java:801)
>>>     at 
>>> java.base/sun.security.ssl.SSLHandshake.consume(SSLHandshake.java:396)
>>>     at 
>>> java.base/sun.security.ssl.HandshakeContext.dispatch(HandshakeContext.java:480)
>>>     at 
>>> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1277)
>>>     at 
>>> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask$DelegatedAction.run(SSLEngineImpl.java:1264)
>>>     at 
>>> java.base/java.security.AccessController.doPrivileged(AccessController.java:712)
>>>     at 
>>> java.base/sun.security.ssl.SSLEngineImpl$DelegatedTask.run(SSLEngineImpl.java:1209)
>>>     at 
>>> org.apache.mina.filter.ssl.SSLHandlerG0.execute_task(SSLHandlerG0.java:743)
>>>     at 
>>> org.apache.mina.filter.ssl.SSLHandlerG0.receive_loop(SSLHandlerG0.java:255)
>>>     at 
>>> org.apache.mina.filter.ssl.SSLHandlerG0.receive(SSLHandlerG0.java:162)
>>>     at 
>>> org.apache.mina.filter.ssl.SslFilter.messageReceived(SslFilter.java:342)
>>>     at 
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650)
>>>     at 
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.access$1300(DefaultIoFilterChain.java:49)
>>>     at 
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain$EntryImpl$1.messageReceived(DefaultIoFilterChain.java:1128)
>>>     at 
>>> org.apache.mina.core.filterchain.IoFilterAdapter.messageReceived(IoFilterAdapter.java:122)
>>>     at 
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.callNextMessageReceived(DefaultIoFilterChain.java:650)
>>>     at 
>>> org.apache.mina.core.filterchain.DefaultIoFilterChain.fireMessageReceived(DefaultIoFilterChain.java:643)
>>>     at 
>>> org.apache.mina.core.polling.AbstractPollingIoProcessor.read(AbstractPollingIoProcessor.java:539)
>>>     at 
>>> org.apache.mina.core.polling.AbstractPollingIoProcessor.access$1200(AbstractPollingIoProcessor.java:68)
>>>     at 
>>> org.apache.mina.core.polling.AbstractPollingIoProcessor$Processor.process(AbstractPollingIoProcessor.java:1224)
>>>     at 
>>>