Commit 3cd36fd4 authored by Matthew Holt's avatar Matthew Holt

tls: Replace '*' with 'wildcard_' in OCSP staple filenames (fix #2071)

Windows doesn't allow asterisk in file names, sigh...
parent aaec7e46
...@@ -35,6 +35,7 @@ import ( ...@@ -35,6 +35,7 @@ import (
"net" "net"
"os" "os"
"path/filepath" "path/filepath"
"strings"
"sync" "sync"
"time" "time"
...@@ -106,7 +107,8 @@ func stapleOCSP(cert *Certificate, pemBundle []byte) error { ...@@ -106,7 +107,8 @@ func stapleOCSP(cert *Certificate, pemBundle []byte) error {
// TODO: Use Storage interface instead of disk directly // TODO: Use Storage interface instead of disk directly
var ocspFileNamePrefix string var ocspFileNamePrefix string
if len(cert.Names) > 0 { if len(cert.Names) > 0 {
ocspFileNamePrefix = cert.Names[0] + "-" firstName := strings.Replace(cert.Names[0], "*", "wildcard_", -1)
ocspFileNamePrefix = firstName + "-"
} }
ocspFileName := ocspFileNamePrefix + fastHash(pemBundle) ocspFileName := ocspFileNamePrefix + fastHash(pemBundle)
ocspCachePath := filepath.Join(ocspFolder, ocspFileName) ocspCachePath := filepath.Join(ocspFolder, ocspFileName)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment