fix file cert mode, support null ShortIds for reality

This commit is contained in:
yuzuki999 2023-07-24 01:24:28 +08:00
parent 99ea46457c
commit cda0b6711e
2 changed files with 7 additions and 0 deletions

View File

@ -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{

View File

@ -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")