From fedad26c136adb09929c6ab807b77f7ff42efded Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Sat, 30 Sep 2023 18:26:39 +0800 Subject: [PATCH] chore: support relative path for hy2/tuic inbound cert --- listener/sing_hysteria2/server.go | 3 +++ listener/tuic/server.go | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/listener/sing_hysteria2/server.go b/listener/sing_hysteria2/server.go index 3628a2ce..7897bd84 100644 --- a/listener/sing_hysteria2/server.go +++ b/listener/sing_hysteria2/server.go @@ -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 diff --git a/listener/tuic/server.go b/listener/tuic/server.go index bfead7f3..12a6ac6d 100644 --- a/listener/tuic/server.go +++ b/listener/tuic/server.go @@ -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