tUse fmt instead of errors to return an error. - tlstun - simple go program to add tls support to other listeners
HTML git clone https://git.parazyd.org/tlstun
DIR Log
DIR Files
DIR Refs
DIR README
DIR LICENSE
---
DIR commit efc47c5928a09f8656e136b97a11979f0d94ea32
DIR parent e1c7528220785e14271e92ee4e38575061d4b6c3
HTML Author: parazyd <parazyd@dyne.org>
Date: Wed, 11 Sep 2019 19:29:10 +0200
Use fmt instead of errors to return an error.
Diffstat:
M tlstun.go | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
---
DIR diff --git a/tlstun.go b/tlstun.go
t@@ -23,8 +23,8 @@ package main
import (
"crypto/tls"
"crypto/x509"
- "errors"
"flag"
+ "fmt"
"io"
"io/ioutil"
"log"
t@@ -58,7 +58,7 @@ func tlsConfig(cert, key string) (*tls.Config, error) {
return nil, err
}
if !certpool.AppendCertsFromPEM(pem) {
- return nil, errors.New("can not parse client certificate authority")
+ return nil, fmt.Errorf("can not parse client certificate authority")
}
tlscfg.ClientCAs = certpool
tlscfg.ClientAuth = tls.RequireAndVerifyClientCert