package main
import (
- "bytes"
"context"
"crypto"
"crypto/sha256"
"log"
"net"
"net/http"
- "os/exec"
"strings"
"sync"
"time"
return hex.EncodeToString(hsh[:])
}
-func certInfo(certRaw []byte) string {
- cmd := exec.Command("certtool", "--certificate-info", "--inder")
- cmd.Stdin = bytes.NewReader(certRaw)
- out, err := cmd.Output()
- if err == nil {
- return string(out)
- }
- return err.Error()
-}
-
func acceptedAdd(addr, h string) {
acceptedM.Lock()
accepted[addr] = h