mirror of
https://git.phreedom.club/localhost_frssoft/compy.git
synced 2025-03-20 05:19:47 +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
1 changed files with 8 additions and 0 deletions
8
compy.go
8
compy.go
|
@ -29,6 +29,14 @@ func main() {
|
||||||
|
|
||||||
p := proxy.New()
|
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 *ca != "" {
|
||||||
if err := p.EnableMitm(*ca, *caKey); err != nil {
|
if err := p.EnableMitm(*ca, *caKey); err != nil {
|
||||||
fmt.Println("not using mitm:", err)
|
fmt.Println("not using mitm:", err)
|
||||||
|
|
Loading…
Add table
Reference in a new issue