summaryrefslogtreecommitdiff
path: root/https.go
diff options
context:
space:
mode:
Diffstat (limited to 'https.go')
-rw-r--r--https.go18
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)
+ }
+}