K6 Skip TLS verify not working, Getting error failed to verify certificate: x509

I have been trying skip TLS verify in K6 scripts.

tried passing “insecureSkipTLSVerify: true” in options

image

passed as flag (–insecure-skip-tls-verify)

After applying above solutions However still getting below error:

msg=“Failed to send the time series data to the endpoint” error=“HTTP POST request failed: Post "[https://.../api/v1/push](https://.../api/v1/push/)”: tls: failed to verify certificate: x509: certificate signed by unknown authority" output=“Prometheus remote write”

TLS handshake is happening still

Any help/pointers are appreciated.
Thanks in advance

Hi @rahulatreysharma

From the error message I assume it occurs while sending the metrics to the prometheus server.
Please try to set the K6_PROMETHEUS_RW_INSECURE_SKIP_TLS_VERIFY environment variable to true also.

Let me know if it helps.

Thank you so much @bandorko Balazs Andorko.

It worked after setting K6_PROMETHEUS_RW_INSECURE_SKIP_TLS_VERIFY environment variable.

1 Like