I have a locally hosted certificate store that i generate with acme.sh and have hosted with lighttpd. I am attemping to use the get_certificate option under the tls directive in order to acquire the cert and key files. However, it keeps coming back with it being unable to find the key. I do see that caddy does try to reach out to the lighttpd server to acquire this key.
For all intents and purposes i have replaced the actual domain name with somedomain
The tls.get_certificate.http module sends requests with the query param server_name having the domain name. Your endpoint needs to be a server that looks at that query param and returns both the cert and key PEM contents concatenated one after the other (one request, not separate requests for the cert and key). Pointing it to a file server won’t work because it won’t be reading from server_name (unless you only have a single domain to serve).
You’ll probably need some actual code to handle the request. Use your scripting language of your choice. It’s really as simple as reading the server_name query param, doing a lookup in your storage to see if you have matching certs/keys, then serving a response body with the cert and key PEM concatenated one after the other. The response should look like: