Wild guess: In the tls_config part you can optionally a ServerName setting. I'm guessing that's what you are trying to do with the Host header.
Does using that instead fix this? On Fri, Feb 19, 2021 at 1:47 PM Kaufman Ng <[email protected]> wrote: > I am trying to use the http module to hit a REST endpoint enabled with > https and basic authentication. But I keep getting 401 status. I confirmed > the username and password works via curl command. > > Anything wrong with my blackbox exporter config here? Thanks in advance! > > modules: > http_2xx: > prober: http > http: > method: GET > valid_status_codes: [200,401] > fail_if_not_ssl: true > headers: > Host: "my-endpoint" > basic_auth: > username: "user" > password: "mypassword" > > -- > You received this message because you are subscribed to the Google Groups > "Prometheus Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/prometheus-users/cd5d797d-71a7-46dd-a55a-91a2aca3ddfbn%40googlegroups.com > <https://groups.google.com/d/msgid/prometheus-users/cd5d797d-71a7-46dd-a55a-91a2aca3ddfbn%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- Marcelo Magallón -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/CABiJYga9TxgyrzMEsOj_M_XZqOuXLv-XZ7wbsqoOW1jB6xWO3g%40mail.gmail.com.

