grafana / k6

A modern load testing tool, using Go and JavaScript - https://k6.io
GNU Affero General Public License v3.0
25.16k stars 1.25k forks source link

k6 ignores macOS Keychain SSL certificates #1192

Closed mcandre closed 11 months ago

mcandre commented 4 years ago

When k6 is run directly on my macOS host, it appears to ignore my macOS Keychain SSL certificates.

As a workaround, I am using the --insecure-skip-tls-verify flag with the run subcommand.

k6 stable 0.25.1 from Homebrew. High Sierra.

na-- commented 4 years ago

That's strange, and is something likely caused by Go. I'm not a Mac user, so I have no idea what the reason could be, @cuonglm, can you investigate?

The only connected issue I could dig up is https://github.com/golang/go/issues/16532, but that was supposedly resolved. In any case, useful data point for consideration in https://github.com/loadimpact/k6/issues/930.

na-- commented 4 years ago

Actually, here's another potentially connected and more recent Go issue: https://github.com/golang/go/issues/24652

cuonglm commented 4 years ago

@mcandre Can you provide more details, or the code you use to trigger the problem?

I tried with mkcert and don't get any errors:

script:

import http from 'k6/http';

export default function() {
  const response = http.get("https://localhost/hello");
};

result:

$ k6 run samples/http_get.js

          /\      |‾‾|  /‾‾/  /‾/
     /\  /  \     |  |_/  /  / /
    /  \/    \    |      |  /  ‾‾\
   /          \   |  |‾\  \ | (_) |
  / __________ \  |__|  \__\ \___/ .io

  execution: local
     output: -
     script: samples/http_get.js

    duration: -,  iterations: 1
         vus: 1, max: 1

    done [==========================================================] 1 / 1

    data_received..............: 1.9 kB 16 kB/s
    data_sent..................: 574 B  4.7 kB/s
    http_req_blocked...........: avg=120.16ms min=120.16ms med=120.16ms max=120.16ms p(90)=120.16ms p(95)=120.16ms
    http_req_connecting........: avg=168µs    min=168µs    med=168µs    max=168µs    p(90)=168µs    p(95)=168µs
    http_req_duration..........: avg=1.64ms   min=1.64ms   med=1.64ms   max=1.64ms   p(90)=1.64ms   p(95)=1.64ms
    http_req_receiving.........: avg=79µs     min=79µs     med=79µs     max=79µs     p(90)=79µs     p(95)=79µs
    http_req_sending...........: avg=1.25ms   min=1.25ms   med=1.25ms   max=1.25ms   p(90)=1.25ms   p(95)=1.25ms
    http_req_tls_handshaking...: avg=117.24ms min=117.24ms med=117.24ms max=117.24ms p(90)=117.24ms p(95)=117.24ms
    http_req_waiting...........: avg=311µs    min=311µs    med=311µs    max=311µs    p(90)=311µs    p(95)=311µs
    http_reqs..................: 1      8.252741/s
    iteration_duration.........: avg=121.51ms min=121.51ms med=121.51ms max=121.51ms p(90)=121.51ms p(95)=121.51ms
    iterations.................: 1      8.252741/s
    vus........................: 1      min=1 max=1
    vus_max....................: 1      min=1 max=1
codebien commented 11 months ago

Closing as this doesn't seem to be an issue as reported from the previous comment. Feel free to reopen and add more details.