Skip to content

localproxy not working properly with aws-iot-client in v1.0.19 of aws.greengrass.SecureTunneling component #154

@dbouras

Description

@dbouras

Describe the bug

After upgrading aws.greengrass.SecureTunneling from v1.0.18 to v1.0.19, using localproxy from MacOS or Linux still connects fine (nothing out of the ordinary in localproxy logs), but when trying to SSH through the tunnel, the SSH connection hangs. When this happens, looking at the logs (file aws.greengrass.SecureTunneling.log) at the other end, every time an SSH connection is initiated  through the localproxy tunnel, I see the following error:

2024-06-21T05:19:56.685Z [INFO] (Copier) aws.greengrass.SecureTunneling: stdout. [ERROR] 2024-06-21 05:19:56.685 [pool-3-thread-3] SubscribeResponseHandler - Secure Tunneling Process: 2024-06-21T05:19:56.684Z [ERROR] {SecureTunnelingContext.cpp}: SecureTunnelingContext::OnSendDataComplete errorCode=13339. {scriptName=services.aws.greengrass.SecureTunneling.lifecycle.run.script, serviceName=aws.greengrass.SecureTunneling, currentState=RUNNING}

I hope someone understands what error code 13339 means.

Interestingly enough, opening an SSH terminal connection from the AWS Web console still works just fine -- the SSH session starts correctly and the above message does not appear.  

To Reproduce

Steps to reproduce the behavior:

  1. deploy aws.greengrass.SecureTunneling v1.0.19
  2. establish a tunnel using localproxy
  3. use ssh to open a terminal connection to the core device
  4. ssh hangs

Expected behavior

ssh successfully establishes a terminal connection

Actual behavior

ssh hangs

Logs

If applicable, add full logs of errors and outputs to help explain your problem. Preferabbly, you can also increase the verbosity, for example to enable debug logs for the localproxy, you can use the cli option -v 6

Environment (please complete the following information):

  • OS: Linux and MacOS
  • Version: Yocto 4.0.18 (kirkstone) and Sonoma 14.5 respectively
  • Architecture: x86-64 and arm64 respectively
  • Localproxy commit: tried d3150e0 and latest 9eace74.   d3150e0  works with aws.greengrass.SecureTunneling v1.0.18 but not with v1.0.19. 9eace74  does not work with either v1.0.18 or v1.0.19.

Additional context

SSH version on Linux:

% ssh -V
OpenSSH_8.4p1, OpenSSL 1.1.1l-fips  24 Aug 2021 SUSE release 150500.17.31.1

SSH version on MacOS:

% ssh -V
OpenSSH_9.7p1, OpenSSL 3.3.0 9 Apr 2024

Rolling back to aws.greengrass.SecureTunneling v1.0.18 and continuing to use localproxy from commit  d3150e0 rectifies the issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions