aboutsummaryrefslogtreecommitdiff
path: root/solve_webroot.go
diff options
context:
space:
mode:
Diffstat (limited to 'solve_webroot.go')
-rw-r--r--solve_webroot.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/solve_webroot.go b/solve_webroot.go
index dc3c878..096ca4a 100644
--- a/solve_webroot.go
+++ b/solve_webroot.go
@@ -19,7 +19,11 @@ func NewWebrootSolver(webroot string) Solver {
func (s *webrootSolver) Solve(ch Challenge) error {
s.file = path.Join(s.webroot, WellKnown, ch.Token)
log.Println("solve webroot", s.file)
- fd, err := CreatePubFile(s.file)
+ err := os.MkdirAll(path.Dir(s.file), 0755)
+ if err != nil {
+ return err
+ }
+ fd, err := CreateFile(s.file, 0644)
if err != nil {
return err
}