mirror of
https://gogs.blitter.com/RLabs/xs
synced 2024-08-14 10:26:42 +00:00
Better error handling (no panic) for client connrefused
Server logs error w/o exiting if missing hkexsh.passwd file Signed-off-by: Russ Magee <rmagee@gmail.com>
This commit is contained in:
parent
cbf3c77342
commit
5511fc83cd
2 changed files with 2 additions and 3 deletions
|
@ -37,8 +37,7 @@ func AuthUserByPasswd(username string, auth string, fname string) (valid bool, a
|
|||
b, e := ioutil.ReadFile(fname) // nolint: gosec
|
||||
if e != nil {
|
||||
valid = false
|
||||
log.Println("ERROR: Cannot read hkexsh.passwd file!")
|
||||
log.Fatal(e)
|
||||
log.Printf("ERROR: Cannot read %s!\n", fname)
|
||||
}
|
||||
r := csv.NewReader(bytes.NewReader(b))
|
||||
|
||||
|
|
|
@ -781,7 +781,7 @@ func main() {
|
|||
conn, err := hkexnet.Dial("tcp", server, cipherAlg, hmacAlg, kexAlg)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
panic(err)
|
||||
os.Exit(3)
|
||||
}
|
||||
defer conn.Close() // nolint: errcheck
|
||||
// From this point on, conn is a secure encrypted channel
|
||||
|
|
Loading…
Reference in a new issue