1
1
mirror of https://github.com/Eugeny/tabby.git synced 2024-11-26 03:27:23 +03:00

Fix SSH X11 Repeated Handshake Issue

This commit is contained in:
cfs4819 2024-03-26 10:56:06 +08:00
parent 10c974f272
commit 53560854a2

View File

@ -205,15 +205,15 @@ export class SSHSession {
}
const hostVerifiedPromise: Promise<void> = new Promise((resolve, reject) => {
let hostkey_old = ''
let hostkeyOld = ''
let isKeyVerified = false
ssh.on('handshake', async handshake => {
if (isKeyVerified) {
resolve()
return
}
if (hostkey_old !== handshake.serverHostKey) {
hostkey_old = handshake.serverHostKey
if (hostkeyOld !== handshake.serverHostKey) {
hostkeyOld = handshake.serverHostKey
if (!await this.verifyHostKey(handshake)) {
this.ssh.end()
reject(new Error('Host key verification failed'))