diff --git a/socketManager.go b/socketManager.go index 9fadfd7..7e220d5 100644 --- a/socketManager.go +++ b/socketManager.go @@ -45,11 +45,11 @@ func (c *_client) connect() { c.connLock.Lock() // Shouldn't matter because the other processes will be waiting, but I'm gonna do it anyways defer c.connLock.Unlock() - rootCAs := x509.NewCertPool() // Initialize a cert pool - rootCert, _ := ioutil.ReadFile("rootCA.pem") // Read our root CA cert - rootCAs.AppendCertsFromPEM(rootCert) // Add it to the pool + rootCAs := x509.NewCertPool() // Initialize a cert pool + rootCert, _ := ioutil.ReadFile("./rootCA.pem") // Read our root CA cert + rootCAs.AppendCertsFromPEM(rootCert) // Add it to the pool - config := &tls.Config{RootCAs: rootCAs,} // Trust our root CA + config := &tls.Config{RootCAs: rootCAs} // Trust our root CA dialer := websocket.Dialer{ // Create a websocket dialer with our tls config TLSClientConfig: config, @@ -117,7 +117,7 @@ func (c *_client) sendData() { p := Packet{nextId(), kindData, byteMsg} // Wrap it into a packet fmt.Printf("Sending packet %v\n", p.ID) - c.connLock.Lock() // Lock to send + c.connLock.Lock() // Lock to send if err := c.conn.WriteJSON(p); err != nil { // Try to send fmt.Printf("Error sending %v packet %v: %v\n", p.Kind, p.ID, err) // If we fail, try to reconnect c.wait.Add(1) // Prevent client things from happening @@ -138,7 +138,7 @@ func (c *_client) readIncoming() { // Read messages from gateway go c.connect() // Reconnect } else { switch packet.Kind { - case kindResponse: // Got a response + case kindResponse: // Got a response go responseManager.received(packet) // Tell the response map default: fmt.Printf("Got unknown packet type: %v\n", packet.Kind)