github.com/Jeffail/benthos/v3@v3.65.0/lib/util/tls/docs.go (about)

     1  package tls
     2  
     3  import "github.com/Jeffail/benthos/v3/internal/docs"
     4  
     5  // FieldSpec returns a spec for a common TLS field.
     6  func FieldSpec() docs.FieldSpec {
     7  	return docs.FieldObject(
     8  		"tls", "Custom TLS settings can be used to override system defaults.",
     9  	).WithChildren(
    10  		docs.FieldBool(
    11  			"enabled", "Whether custom TLS settings are enabled.",
    12  		).HasDefault(false),
    13  
    14  		docs.FieldBool(
    15  			"skip_cert_verify", "Whether to skip server side certificate verification.",
    16  		).HasDefault(false),
    17  
    18  		docs.FieldBool(
    19  			"enable_renegotiation", "Whether to allow the remote server to repeatedly request renegotiation. Enable this option if you're seeing the error message `local error: tls: no renegotiation`.",
    20  		).AtVersion("3.45.0").Advanced().HasDefault(false),
    21  
    22  		docs.FieldString(
    23  			"root_cas", "An optional root certificate authority to use. This is a string, representing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.", "-----BEGIN CERTIFICATE-----\n...\n-----END CERTIFICATE-----",
    24  		).HasDefault(""),
    25  
    26  		docs.FieldString(
    27  			"root_cas_file", "An optional path of a root certificate authority file to use. This is a file, often with a .pem extension, containing a certificate chain from the parent trusted root certificate, to possible intermediate signing certificates, to the host certificate.", "./root_cas.pem",
    28  		).HasDefault(""),
    29  
    30  		docs.FieldObject(
    31  			"client_certs", "A list of client certificates to use. For each certificate either the fields `cert` and `key`, or `cert_file` and `key_file` should be specified, but not both.",
    32  			[]interface{}{
    33  				map[string]interface{}{
    34  					"cert": "foo",
    35  					"key":  "bar",
    36  				},
    37  			},
    38  			[]interface{}{
    39  				map[string]interface{}{
    40  					"cert_file": "./example.pem",
    41  					"key_file":  "./example.key",
    42  				},
    43  			},
    44  		).Array().WithChildren(
    45  			docs.FieldString("cert", "A plain text certificate to use.").HasDefault(""),
    46  			docs.FieldString("key", "A plain text certificate key to use.").HasDefault(""),
    47  			docs.FieldString("cert_file", "The path to a certificate to use.").HasDefault(""),
    48  			docs.FieldString("key_file", "The path of a certificate key to use.").HasDefault(""),
    49  		),
    50  	).Advanced()
    51  }