Skip to content

Commit 5754103

Browse files
committed
Delete the CA when requested
1 parent 958537f commit 5754103

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

conn.go

+11-2
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@
33
package main
44

55
import (
6+
"net/http"
7+
"os"
8+
"strconv"
9+
610
log "github.com/Sirupsen/logrus"
711
"github.com/gin-gonic/gin"
812
"github.com/googollee/go-socket.io"
9-
"net/http"
10-
"strconv"
1113
)
1214

1315
type connection struct {
@@ -101,6 +103,13 @@ func wsHandler() *WsServer {
101103
so.On("command", func(message string) {
102104
h.broadcast <- []byte(message)
103105
})
106+
107+
so.On("deleteCA", func() {
108+
os.Remove("ca.cert.pem")
109+
os.Remove("ca.cert.cer")
110+
os.Remove("ca.key.pem")
111+
})
112+
104113
so.On("disconnection", func() {
105114
h.unregister <- c
106115
})

0 commit comments

Comments
 (0)