Tweets

lördag 9 juli 2011

Qnap, SSL-certificate and dynamic DNS

I have a qnap 219p which I sometimes need to access remotely and view the administration web interface. I have been avoiding this outside my lan since I haven't taken time to configure a secure connection. It was time to do something about this. I have been thinking of getting a router with vpn support, namely the MikroTik RB750GL, but wanted to give ssl  a shot. The precondition of using ssl to access my qnap outside the lan was that it should be working with dynamic dns.

A quick search revealed that a lot of people had problem getting this to work. It took me some time but I finally got it working. Here is my approach. Please feel free to comment about improvement in both approach and security, since this was mostly a "just-getting-it-to-work-solution".

I followed this a bit outdated guideline. I repeat the steps in case the link gets broken:

  1. download OpenSSL from here and install
  2. open cmd with administrative privileges (win 7) and navigate to <OpenSSL-install-dir>\bin
  3. generate private key: openssl genrsa -out priv.key 1024
  4. generate certificate: openssl req -new -key priv.key -out server.crt -x509 -days 365 (where x509 is the certificate format accepted by qnap and 365 is the number of days the certificate is valid and maybe the next time you read this post :P)
  5. copy all the value of each file to corresponding form in qnap > system administration > security > import ssl secure certificate and click upload
  6. when the upload is ready: download and open the certificate. Chose to install it and make sure you chose the certificate store: "trusted root certification authorities".

There was one thing more. Since ssl uses port 443 I needed open it in my dlink dir-655 and rout it to the ip of the qnap.


After this I was able to login using my dynamic dns link and port: <my-dyndns-link>:8080. Well, this port is my private, I use another one as my public and reroute it in my router and it is working just fine.

The certificate can be verified here http://www.digicert.com/help/ using only the dynamic dns link.