mirror of
https://github.com/cedar2025/hysteria.git
synced 2025-06-21 12:09:49 +00:00
Merge pull request #547 from apernet/wip-exclusive-acme-cert
feat: make acme and cert options mutually exclusive to avoid user confusion
This commit is contained in:
commit
3e1d2a8c92
@ -104,6 +104,9 @@ func (c *serverConfig) Check() error {
|
|||||||
if len(c.ACME.Domains) == 0 && (len(c.CertFile) == 0 || len(c.KeyFile) == 0) {
|
if len(c.ACME.Domains) == 0 && (len(c.CertFile) == 0 || len(c.KeyFile) == 0) {
|
||||||
return errors.New("need either ACME info or cert/key files")
|
return errors.New("need either ACME info or cert/key files")
|
||||||
}
|
}
|
||||||
|
if len(c.ACME.Domains) > 0 && (len(c.CertFile) > 0 || len(c.KeyFile) > 0) {
|
||||||
|
return errors.New("cannot use both ACME and cert/key files, they are mutually exclusive")
|
||||||
|
}
|
||||||
if up, down, err := c.Speed(); err != nil || (up != 0 && up < minSpeedBPS) || (down != 0 && down < minSpeedBPS) {
|
if up, down, err := c.Speed(); err != nil || (up != 0 && up < minSpeedBPS) || (down != 0 && down < minSpeedBPS) {
|
||||||
return errors.New("invalid speed")
|
return errors.New("invalid speed")
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user