Skip to content

Commit

Permalink
Merge pull request #20 from gemini-testing/sp.fix.sshrsa
Browse files Browse the repository at this point in the history
fix: add ssh-rsa options separately
  • Loading branch information
sipayRT authored Aug 13, 2024
2 parents 50280b9 + e269c77 commit 98c5d57
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,14 +170,14 @@ var Tunnel = inherit(EventEmitter, {
// heartbeat messages existence is logged to debug3 (penSSH_7.9p1, LibreSSL 2.7.3, macOC Catalina)
this._shouldBeVerbose() ? '-vvv' : '-v',
this._strictHostKeyChecking === false ? '-o StrictHostKeyChecking=no' : '',
this._enableDeprecatedSshRsa && '-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa',
this._enableDeprecatedSshRsa && ['-o HostKeyAlgorithms=+ssh-rsa', '-o PubkeyAcceptedKeyTypes=+ssh-rsa'],
this._compression !== undefined ?
util.format('-o Compression=%s', this._compression ? 'yes' : 'no')
: '',
this._identity ? util.format('-i %s', this._identity) : '',
util.format('-p %d', this._sshPort),
(this.user ? this.user + '@' : '') + this.host
].filter(Boolean);
].filter(Boolean).flat();
},

_shouldBeVerbose: function () {
Expand Down
3 changes: 2 additions & 1 deletion test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,8 @@ describe('Tunnel', function () {

var sshArgs = childProcess.spawn.lastCall.args[1];

expect(sshArgs).to.contain('-o HostKeyAlgorithms=+ssh-rsa -o PubkeyAcceptedKeyTypes=+ssh-rsa');
expect(sshArgs).to.contain('-o HostKeyAlgorithms=+ssh-rsa');
expect(sshArgs).to.contain('-o PubkeyAcceptedKeyTypes=+ssh-rsa');
});

it('should reject tunnel opening if failed to create tunnel', function () {
Expand Down

0 comments on commit 98c5d57

Please sign in to comment.