ballerina-platform / ballerina-library

The Ballerina Library
https://ballerina.io/learn/api-docs/ballerina/
Apache License 2.0
136 stars 64 forks source link

SFTP connection without private key failing in Mac #6769

Open dilanSachi opened 3 months ago

dilanSachi commented 3 months ago

Description: Consider the following sample.

ftp:Client ccc = checkpanic new ({
        protocol: ftp:SFTP,
        host: "url",
        port: 22,
        auth: {
            credentials: {
                username: "user",
                password: "password"
            }
        }
    });

When the private key is not specified, the program terminates with below error. This is only occuring on MacOS.

error: Error while connecting to the FTP server with URL: sftp://user:pass@url:22
        at ballerina.ftp.2:initEndpoint(external_functions.bal:19)
           ballerina.ftp.2.Client:init(client_endpoint.bal:29)
           replace_placeholders:main(replace_placeholders.bal:6)
cause: invalid privatekey: [B@50f3d2be
        at ballerina.ftp.2:initEndpoint(external_functions.bal:19)
           ... 3 more