Package Status:

- Fix text formatting

Package HTTPServer:
  - fix TLS check, config & loading for server

Bump dependancies
  - change nutsdb owner repos
This commit is contained in:
nabbar
2023-02-28 15:00:34 +01:00
parent 443935a407
commit 854c2fa6e7
14 changed files with 45 additions and 48 deletions

View File

@@ -251,9 +251,9 @@ func (c *Config) GetTLS() (libtls.TLSConfig, liberr.Error) {
}
func (c *Config) CheckTLS() (libtls.TLSConfig, liberr.Error) {
if ssl, err := c.GetTLS(); err == nil {
if ssl, err := c.GetTLS(); err != nil {
return nil, err
} else if ssl != nil && ssl.LenCertificatePair() > 0 {
} else if ssl == nil || ssl.LenCertificatePair() < 1 {
return nil, ErrorServerValidate.ErrorParent(fmt.Errorf("not certificates defined"))
} else {
return ssl, nil

View File

@@ -41,7 +41,8 @@ import (
func (o *srv) Start(ctx context.Context) error {
ssl := o.cfgGetTLS()
if ssl == nil && o.IsTLS() {
if o.IsTLS() && ssl == nil {
return ErrorServerValidate.ErrorParent(fmt.Errorf("TLS Config is not well defined"))
}
@@ -62,6 +63,9 @@ func (o *srv) Start(ctx context.Context) error {
}
if e := o.cfgGetServer().initServer(s); e != nil {
ent := o.logger().Entry(liblog.ErrorLevel, "init http2 server")
ent.ErrorAdd(true, e)
ent.Log()
return e
}