examples/client: Fix certificate trust check
This commit is contained in:
parent
a5493b708a
commit
7d958a4798
@ -64,10 +64,10 @@ func trustCertificate(hostname string, cert *x509.Certificate) error {
|
|||||||
if ok {
|
if ok {
|
||||||
// Check fingerprint
|
// Check fingerprint
|
||||||
if knownHost.Fingerprint != host.Fingerprint {
|
if knownHost.Fingerprint != host.Fingerprint {
|
||||||
return nil
|
|
||||||
}
|
|
||||||
return errors.New("error: fingerprint does not match!")
|
return errors.New("error: fingerprint does not match!")
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
fmt.Printf(trustPrompt, hostname, host.Fingerprint)
|
fmt.Printf(trustPrompt, hostname, host.Fingerprint)
|
||||||
scanner.Scan()
|
scanner.Scan()
|
||||||
|
Loading…
Reference in New Issue
Block a user