How do I use a self-signed certificate with an Apache server linked to a dynamic DNS service? [closed]

I have a Linux Apache web server running ownCloud set up. I wish to use a dynamic DNS service (such as No-IP Free) with this server because my public IP address is not static. I also wish to use a self-signed certificate (I know of the risks) with the server. When generating a self-signed certificate using OpenSSL via the command line, it asks me for the ‘Fully Qualified Domain Name’ of the server. I do not have a domain name. What should I enter into this field: the static local network IP of the server (e.g. 192.168.1.5); the dynamic public IP (e.g. 192.0.2.1) of my router (I will forward the port); or the dynamic DNS domain name that I will use (e.g. myserver.ddns.net)?

Answer

The common name or CN is the domain name, which you enter into the URL-bar of your browser. It’s the name, you use to refer to the server/website/service and the browser or any other client will compare these two values for verification. In your example, it will be myserver.ddns.net.

If you wish to use owncloud-setup via the IP (which is not the case here), you want to give the IP as common name.

Also, if you want to be able to access the setup via the domain and the (local) IP, you can use Subject Alternative Name/ SubjectAltName (SAN). This can be useful, if you want to access it without internet access, because it’s hosted in the local network (and it’s faster, as the data only travels inside your network, otherwise, it goes through out through your modem and comes back again).

Attribution
Source : Link , Question Author : Robert , Answer Author : sebix

Leave a Comment