mirror of
https://git.phreedom.club/localhost_frssoft/compy.git
synced 2024-11-05 16:03:19 +00:00
Merge pull request #5 from andrewgaul/missing-cert-key-error
Add friendly error for missing cert or key
This commit is contained in:
commit
cac3b84a5d
8
compy.go
8
compy.go
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue