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) } }