* Make CertFile and KeyFile relative to CustomPath The current code will absolute CertFile and KeyFile against the current working directory. This is quite unexpected for users. This code makes relative paths absolute against the CustomPath. Fix #4196 * Improve error reporting when reading certificates * Apply suggestions from code review Co-Authored-By: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
parent
8add1dfacc
commit
bcb722daec
4 changed files with 27 additions and 6 deletions
|
@ -554,6 +554,12 @@ func NewContext() {
|
|||
Protocol = HTTPS
|
||||
CertFile = sec.Key("CERT_FILE").String()
|
||||
KeyFile = sec.Key("KEY_FILE").String()
|
||||
if !filepath.IsAbs(CertFile) && len(CertFile) > 0 {
|
||||
CertFile = filepath.Join(CustomPath, CertFile)
|
||||
}
|
||||
if !filepath.IsAbs(KeyFile) && len(KeyFile) > 0 {
|
||||
KeyFile = filepath.Join(CustomPath, KeyFile)
|
||||
}
|
||||
case "fcgi":
|
||||
Protocol = FCGI
|
||||
case "fcgi+unix":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue