mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
tls: Replace '*' with 'wildcard_' in OCSP staple filenames (fix #2071)
Windows doesn't allow asterisk in file names, sigh...
This commit is contained in:
parent
aaec7e469c
commit
3cd36fd47d
1 changed files with 3 additions and 1 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue