HTTP authentication for local server

Hello.
is there a way of securing the API by e.g. HTTP basic auth? Or to force clients to use client certs or something? I’d like to prevent anybody to be able to read/update the pin values on devices using HTTP API.

thanks