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:
parent
10c974f272
commit
53560854a2
@ -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'))
|
||||
|
Loading…
Reference in New Issue
Block a user