Skip to content
This repository has been archived by the owner on Apr 11, 2023. It is now read-only.

Commit

Permalink
Merge pull request #146 from vkubiv/feat-bdd-context-without-ca
Browse files Browse the repository at this point in the history
feat: add the possibility to create bdd context with out CA certs path
  • Loading branch information
fqutishat committed Dec 29, 2021
2 parents c436524 + 61397a7 commit ebb75c5
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions test/bdd/pkg/context/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,20 @@ type BDDContext struct {

// NewBDDContext create new BDDContext.
func NewBDDContext(caCertPath string) (*BDDContext, error) {
rootCAs, err := tlsutils.GetCertPool(false, []string{caCertPath})
if err != nil {
return nil, err
var tlsConfig *tls.Config

if caCertPath != "" {
rootCAs, err := tlsutils.GetCertPool(false, []string{caCertPath})
if err != nil {
return nil, err
}

tlsConfig = &tls.Config{
RootCAs: rootCAs, MinVersion: tls.VersionTLS12,
}
}

return &BDDContext{tlsConfig: &tls.Config{RootCAs: rootCAs}}, nil
return &BDDContext{tlsConfig: tlsConfig}, nil
}

// TLSConfig return tls config.
Expand Down

0 comments on commit ebb75c5

Please sign in to comment.