From cda0b6711ea3363dfdf88f75d733ff3cca5ce972 Mon Sep 17 00:00:00 2001 From: yuzuki999 Date: Mon, 24 Jul 2023 01:24:28 +0800 Subject: [PATCH] fix file cert mode, support null ShortIds for reality --- core/xray/inbound.go | 6 ++++++ node/cert.go | 1 + 2 files changed, 7 insertions(+) diff --git a/core/xray/inbound.go b/core/xray/inbound.go index 55e67b1..96c87f0 100644 --- a/core/xray/inbound.go +++ b/core/xray/inbound.go @@ -80,6 +80,9 @@ func buildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s if err != nil { return nil, fmt.Errorf("marshal reality dest error: %s", err) } + if len(in.StreamSetting.REALITYSettings.ShortIds) == 0 { + config.CertConfig.RealityConfig.ShortIds = []string{""} + } in.StreamSetting.REALITYSettings = &coreConf.REALITYConfig{ Dest: d, Xver: config.CertConfig.RealityConfig.Xver, @@ -99,6 +102,9 @@ func buildInbound(config *conf.ControllerConfig, nodeInfo *panel.NodeInfo, tag s if err != nil { return nil, fmt.Errorf("marshal reality dest error: %s", err) } + if len(rc.ShortIds) == 0 { + rc.ShortIds = []string{""} + } Xver, _ := strconv.ParseUint(rc.Xver, 10, 64) MaxTimeDiff, _ := strconv.ParseUint(rc.Xver, 10, 64) in.StreamSetting.REALITYSettings = &coreConf.REALITYConfig{ diff --git a/node/cert.go b/node/cert.go index ed79016..1df319c 100644 --- a/node/cert.go +++ b/node/cert.go @@ -28,6 +28,7 @@ func (c *Controller) requestCert() error { if c.CertConfig.CertFile == "" || c.CertConfig.KeyFile == "" { return fmt.Errorf("cert file path or key file path not exist") } + return nil case "dns", "http": if c.CertConfig.CertFile == "" || c.CertConfig.KeyFile == "" { return fmt.Errorf("cert file path or key file path not exist")