From 3cd36fd47d7955711081e6b7cb03355b32d202ff Mon Sep 17 00:00:00 2001 From: Matthew Holt Date: Wed, 14 Mar 2018 21:58:59 -0600 Subject: [PATCH] tls: Replace '*' with 'wildcard_' in OCSP staple filenames (fix #2071) Windows doesn't allow asterisk in file names, sigh... --- caddytls/crypto.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/caddytls/crypto.go b/caddytls/crypto.go index 5aac8ae9d..f2ea4f9b5 100644 --- a/caddytls/crypto.go +++ b/caddytls/crypto.go @@ -35,6 +35,7 @@ import ( "net" "os" "path/filepath" + "strings" "sync" "time" @@ -106,7 +107,8 @@ func stapleOCSP(cert *Certificate, pemBundle []byte) error { // TODO: Use Storage interface instead of disk directly var ocspFileNamePrefix string if len(cert.Names) > 0 { - ocspFileNamePrefix = cert.Names[0] + "-" + firstName := strings.Replace(cert.Names[0], "*", "wildcard_", -1) + ocspFileNamePrefix = firstName + "-" } ocspFileName := ocspFileNamePrefix + fastHash(pemBundle) ocspCachePath := filepath.Join(ocspFolder, ocspFileName)