I have a big Windows video/audio application that may be controlled remotely over a web server. For that, I can listen to a local port in a, say, 192.168.1.10 system to port 8000, forward the port via NAT and have a remote browser connect to http://public.ip:8000.
The problem is now that, to have some features available for that, say, microphone recording or QUIC access, I need https. This will inevitably result in the nasty browser warning of a self-signed certificate.
I thought of a possible solution. I could get myself a cheap domain name which can have a nameserver on my Centos 7 server, for example example.xyz. Then for user having a public IP of 1.2.3.4 and wants to enable the web https server I could configure a subdomain 1.2.3.4.example.xyz which can point to the 1.2.3.4 IP and then have letsencrypt generate immediately a certificate for that server, pass it to the user and https connection is now viable.
Is the above reasoning valid? Can I somehow control/automate via, say, a PHP script, the generation of a subdomain that points to a specific IP and calls letsencrypt to generate the certificate?