serve wildcard certificate files

This commit is contained in:
m5r
2023-12-12 23:05:57 +01:00
parent 18932d3873
commit c639bddaeb
2 changed files with 19 additions and 1 deletions

15
http/server.go Normal file
View File

@ -0,0 +1,15 @@
package http
import (
"net/http"
)
func ServeCertificate() {
http.HandleFunc("/server.key", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "/certs/server.key")
})
http.HandleFunc("/server.pem", func(w http.ResponseWriter, r *http.Request) {
http.ServeFile(w, r, "/certs/server.pem")
})
http.ListenAndServe(":9229", nil)
}