I am trying to access LXD REST API over the Network.
Followed : Link to Doc.
lxc config set core.https_address "[::]:8443"
lxc config set core.trust_password <some random password>
curl -s -k --cert ~/.config/lxc/client.crt --key ~/.config/lxc/client.key https://127.0.0.1:8443/1.0/certificates -X POST -d '{"type": "client", "password": "some-password"}' | jq
As stated Here the official REST API Doc.
GET to / is allowed for everyone (lists the API endpoints)
But on pointing the Browser (Chrome) to
http://<server-ip>:8443
https://<server-ip>:8443
Both result in ERR_INVALID_HTTP_RESPONSE
.
Added the client.crt
to Windows 10 certificated, via Chrome > Settings > Manage Certificated and Import.
Tried it with POSTMAN
Still the same issue.
Works all fine , when access from inside the server.
curl -s -k --cert ~/.config/lxc/client.crt --key ~/.config/lxc/client.key https://127.0.0.1:8443/1.0 | jq .metadata.auth
The above command works fine.
My understanding of certificate based auth is very limited. Any pointer would be very much appreciated.