mirror of
https://github.com/mumble-voip/grumble.git
synced 2025-12-21 18:41:56 -08:00
Add ability to autogen self-signed x509 certs for use with Grumble.
This commit is contained in:
parent
f36ae37afd
commit
1cc9745727
4 changed files with 105 additions and 3 deletions
|
|
@ -9,13 +9,14 @@ import (
|
|||
"encoding/pem"
|
||||
"crypto/x509"
|
||||
"io/ioutil"
|
||||
"path/filepath"
|
||||
)
|
||||
|
||||
func NewTLSListener(port int) (rl *tls.Listener) {
|
||||
rl = nil
|
||||
|
||||
// Load the certificate
|
||||
pemBytes, err := ioutil.ReadFile("grumble.crt")
|
||||
pemBytes, err := ioutil.ReadFile(filepath.Join(*datadir, "cert"))
|
||||
if err != nil {
|
||||
log.Printf("Failed to read server.crt: %s", err)
|
||||
return
|
||||
|
|
@ -29,7 +30,7 @@ func NewTLSListener(port int) (rl *tls.Listener) {
|
|||
}
|
||||
|
||||
// Load the private key
|
||||
keyBytes, err := ioutil.ReadFile("grumble.key")
|
||||
keyBytes, err := ioutil.ReadFile(filepath.Join(*datadir, "key"))
|
||||
if err != nil {
|
||||
log.Printf("Failed to read server.key.insecure: %s", err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue