Skip to main content


This package contains client TLS configuration and function to create tls.Config from it.

Every module that needs tls.Config for data collection should use it. It allows to have same set of user configurable options across all modules.

Configuration options

  • tls_skip_verify: controls whether a client verifies the server's certificate chain and host name.
  • tls_ca: certificate authority to use when verifying server certificates.
  • tls_cert: tls certificate to use.
  • tls_key: tls key to use.


Just make TLSConfig part of your module configuration.

package example

import ""

type Config struct {
tlscfg.TLSConfig `yaml:",inline"`

type Example struct {
Config `yaml:",inline"`

func (e *Example) Init() bool {
tlsCfg, err := tlscfg.NewTLSConfig(e.TLSConfig)
if err != nil {
// ...
return false

// ...
return true

Having TLSConfig embedded your configuration inherits all configuration options:

- name: name
tls_skip_verify: no
tls_ca: path/to/ca.pem
tls_cert: path/to/cert.pem
tls_key: path/to/key.pem

Do you have any feedback for this page? If so, you can open a new issue on our netdata/learn repository.