mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-04-30 09:18:34 +00:00
Add OCSP Stapling for TLS & XTLS (#92)
This commit is contained in:
parent
6f25191822
commit
3d7e86efba
9 changed files with 312 additions and 106 deletions
|
@ -247,11 +247,12 @@ func readFileOrString(f string, s []string) ([]byte, error) {
|
|||
}
|
||||
|
||||
type TLSCertConfig struct {
|
||||
CertFile string `json:"certificateFile"`
|
||||
CertStr []string `json:"certificate"`
|
||||
KeyFile string `json:"keyFile"`
|
||||
KeyStr []string `json:"key"`
|
||||
Usage string `json:"usage"`
|
||||
CertFile string `json:"certificateFile"`
|
||||
CertStr []string `json:"certificate"`
|
||||
KeyFile string `json:"keyFile"`
|
||||
KeyStr []string `json:"key"`
|
||||
Usage string `json:"usage"`
|
||||
OcspStapling int64 `json:"ocspStapling"`
|
||||
}
|
||||
|
||||
// Build implements Buildable.
|
||||
|
@ -282,7 +283,7 @@ func (c *TLSCertConfig) Build() (*tls.Certificate, error) {
|
|||
default:
|
||||
certificate.Usage = tls.Certificate_ENCIPHERMENT
|
||||
}
|
||||
|
||||
certificate.OcspStapling = c.OcspStapling
|
||||
return certificate, nil
|
||||
}
|
||||
|
||||
|
@ -328,11 +329,12 @@ func (c *TLSConfig) Build() (proto.Message, error) {
|
|||
}
|
||||
|
||||
type XTLSCertConfig struct {
|
||||
CertFile string `json:"certificateFile"`
|
||||
CertStr []string `json:"certificate"`
|
||||
KeyFile string `json:"keyFile"`
|
||||
KeyStr []string `json:"key"`
|
||||
Usage string `json:"usage"`
|
||||
CertFile string `json:"certificateFile"`
|
||||
CertStr []string `json:"certificate"`
|
||||
KeyFile string `json:"keyFile"`
|
||||
KeyStr []string `json:"key"`
|
||||
Usage string `json:"usage"`
|
||||
OcspStapling int64 `json:"ocspStapling"`
|
||||
}
|
||||
|
||||
// Build implements Buildable.
|
||||
|
@ -363,7 +365,7 @@ func (c *XTLSCertConfig) Build() (*xtls.Certificate, error) {
|
|||
default:
|
||||
certificate.Usage = xtls.Certificate_ENCIPHERMENT
|
||||
}
|
||||
|
||||
certificate.OcspStapling = c.OcspStapling
|
||||
return certificate, nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue