Forum Discussion

kgaigl's avatar
kgaigl
Icon for Cirrocumulus rankCirrocumulus
Jan 20, 2021

HTTPS Monitor: JSON File behind login page

Hello,

we've already a https monitor that reads the contents of a json file, it looks like this:

send string: GET /intern/api/v1/health/portal-status HTTP/1.1\r\nHost: host.company.com\r\n\r\n
receive strimg: \"portalStatus\":\"AVAILABLE\"

this works fine.

but now I need a similar monitor, but the json file is passwort protectet, when I add username/password to the monitor, it doesn't work.

when I do a curl:

curl -sku monitor:<pw> -H "Content-Type: application/json" -X GET https://host.company.int/monitor/wga/widgets/health.json

I get the logon-page for the username/pw

I tried some other parameter for curl, but I don't get the content of the json-file.

Any ideas?

thanks in advance

  • kgaigl's avatar
    kgaigl
    Icon for Cirrocumulus rankCirrocumulus

    I've read an article, that http1.1 needs the host-statement, and http1.0 not, so I tried http1.0 without host-statement and that's working.

     

    I'm not sure if the backend supports 1.1, maybe I ask the devs, but with this I'm happy

     

    the first post was from another application, sorry for the confusion, we're confused by the devs too ;-)

    • Grrrhhhh ;) I told to check long back on the host header. I don't think it's an issue with http1.0 or http1.1, but it could be the host header. Some web has site binding, so it requires proper dns name, else all requests goto 403 or some other homepage.​