chore: support relative path for hy2/tuic inbound cert

This commit is contained in:
Larvan2 2023-09-30 18:26:39 +08:00 committed by wwqgtxx
parent a526bb70ea
commit fedad26c13
2 changed files with 7 additions and 0 deletions

View File

@ -50,6 +50,9 @@ func New(config LC.Hysteria2Server, tunnel C.Tunnel, additions ...inbound.Additi
sl = &Listener{false, config, nil, nil}
config.Certificate = C.Path.Resolve(config.Certificate)
config.PrivateKey = C.Path.Resolve(config.PrivateKey)
cert, err := CN.ParseCert(config.Certificate, config.PrivateKey)
if err != nil {
return nil, err

View File

@ -43,6 +43,10 @@ func New(config LC.TuicServer, tunnel C.Tunnel, additions ...inbound.Addition) (
Type: C.TUIC,
Additions: additions,
}
config.Certificate = C.Path.Resolve(config.Certificate)
config.PrivateKey = C.Path.Resolve(config.PrivateKey)
cert, err := CN.ParseCert(config.Certificate, config.PrivateKey)
if err != nil {
return nil, err