is it possible to obtain a certificate for my DDNS domain that points to my local PC where I opened ports 80 and 443 only with port forwarding on other posts (e.g. 9480, 9443)?
So when I need to access my PC from the internet I run:
Ah, thanks, that’s a pity!
I just wanted to add a Nextcloud docker container to my PC and to protect it from the internet I wanted to keep ports 443 and 80 not directly opened so I created a port forwarding with other ports.
I also was using a letsencrypt docker companion container to auto obtain a SSL certificate and now I understand why it was not working when using https://mydomain.ddns.net or https://mydomain.ddns.net:9443 as domain.
I think I need to find an alternative.
If you don't mind to change the dynamic dns provider, you could use dynu.com (it is free, allows txt records and has an API) and acme.sh client supports it so you could issue your certificates using it.
I wrote a mini guide a few months ago if you want to take a look.