Merge pull request #5 from andrewgaul/missing-cert-key-error

Add friendly error for missing cert or key
This commit is contained in:
Barna Csorogi 2017-01-14 04:02:23 +01:00 committed by GitHub
commit cac3b84a5d

View file

@ -29,6 +29,14 @@ func main() {
p := proxy.New()
if (*ca == "") != (*caKey == "") {
log.Fatalln("must specify both CA certificate and key")
}
if (*cert == "") != (*key == "") {
log.Fatalln("must specify both certificate and key")
}
if *ca != "" {
if err := p.EnableMitm(*ca, *caKey); err != nil {
fmt.Println("not using mitm:", err)