()
| 582 | } |
| 583 | |
| 584 | func (o *Options) CABundle() ([]byte, error) { |
| 585 | if o.SSLCertBase64 == "" { |
| 586 | return nil, nil |
| 587 | } |
| 588 | |
| 589 | certPool, err := x509.SystemCertPool() |
| 590 | if err != nil { |
| 591 | return nil, fmt.Errorf("get global system cert pool: %w", err) |
| 592 | } |
| 593 | data, err := base64.StdEncoding.DecodeString(o.SSLCertBase64) |
| 594 | if err != nil { |
| 595 | return nil, fmt.Errorf("base64 decode ssl cert: %w", err) |
| 596 | } |
| 597 | ok := certPool.AppendCertsFromPEM(data) |
| 598 | if !ok { |
| 599 | return nil, fmt.Errorf("failed to append the ssl cert to the global pool: %s", data) |
| 600 | } |
| 601 | return data, nil |
| 602 | } |
| 603 | |
| 604 | func skipDeprecatedOptions(options []serpent.Option) []serpent.Option { |
| 605 | var activeOptions []serpent.Option |
no outgoing calls
no test coverage detected