mirror of
https://git.phreedom.club/localhost_frssoft/compy.git
synced 2024-11-06 00:13:20 +00:00
Add friendly error for missing cert or key
Previously compy failed with the confusing: 2017/01/13 15:34:38 open : no such file or directory
This commit is contained in:
parent
635da9b1a6
commit
a7569356c1
8
compy.go
8
compy.go
|
@ -26,6 +26,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