diff options
| author | Jeff Carr <[email protected]> | 2024-01-12 04:14:09 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-12 04:14:09 -0600 |
| commit | 83ad5524015e155e6250743e01eeed7234ccb5a5 (patch) | |
| tree | 6d2aa0e43faf6ee383c5739d1df837264841da01 /https.go | |
initial commit
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'https.go')
| -rw-r--r-- | https.go | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/https.go b/https.go new file mode 100644 index 0000000..33a1099 --- /dev/null +++ b/https.go @@ -0,0 +1,18 @@ +package main + +import ( + "fmt" + "net/http" +) + +func https() { + http.HandleFunc("/", okHandler) + + certPath := "/etc/letsencrypt/live/yourdomain.com/fullchain.pem" + keyPath := "/etc/letsencrypt/live/yourdomain.com/privkey.pem" + + err := http.ListenAndServeTLS(":443", certPath, keyPath, nil) + if err != nil { + fmt.Println("Error starting HTTPS server:", err) + } +} |
