Skip to content

Commit

Permalink
Merge pull request #41 from aWZHY0yQH81uOYvH/fix-40
Browse files Browse the repository at this point in the history
Fix minor issues with privilege dropping feature
  • Loading branch information
patrickhener authored May 29, 2023
2 parents e68e0f0 + 2b8beb7 commit 33c8a14
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion httpserver/drop_unix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//go:build linux || darwin
//go:build unix

package httpserver

Expand Down
12 changes: 12 additions & 0 deletions httpserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"net"
"net/http"
"time"
"crypto/tls"

"github.com/gorilla/mux"
"github.com/patrickhener/goshs/ca"
Expand Down Expand Up @@ -108,6 +109,17 @@ func (fs *FileServer) Start(what string) {
if err != nil {
logger.Fatalf("Unable to start SSL enabled server: %+v\n", err)
}

cert, err := tls.LoadX509KeyPair(fs.MyCert, fs.MyKey)
if err != nil {
logger.Fatalf("Failed to load provided key or certificate: %+v\n", err)
}

server.TLSConfig = &tls.Config{
Certificates: []tls.Certificate{cert},
MinVersion: tls.VersionTLS12,
}

fs.Fingerprint256 = fingerprint256
fs.Fingerprint1 = fingerprint1
fs.logStart(what)
Expand Down

0 comments on commit 33c8a14

Please sign in to comment.