SSL and Intermediate Certificates

Discussion on setting up QNAP NAS products.

SSL and Intermediate Certificates

Postby pwnzicles » Sun May 20, 2012 12:19 am

Hopefully this saves some one some where some time.

Proper SSL configuration requires three things: 1) a private key; 2) a server certificate; 3) an intermediate certificate. You'll generate the key yourself (there are tutorials about this all over the place), and you'll get the other two files from your SSL provider.

The QNAP admin GUI allows you to upload your private key and your server certificate, but there is no way to include the intermediate certificate -- http://en.wikipedia.org/wiki/Intermediate_certificate_authorities -- that tells browsers that your server is well and truly secure. Without this intermediate certificate installed, most browsers will show a warning when connecting to your QNAP that "the certificate publisher cannot be verified," or something to that effect.

To fix this, you'll need to manually edit the PEM file that the QNAP GUI writes your keys to. Here we go...

  1. Log into your server. I suggest using Putty -- http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html.
  2. Enter the following code exactly:
    Code: Select all
    vi /etc/stunnel/stunnel.pem
  3. You should see wall of characters, mostly jibberish, looking something like this:
    Code: Select all
    -----BEGIN RSA PRIVATE KEY-----
    [characters]
    -----END RSA PRIVATE KEY-----
    -----BEGIN CERTIFICATE-----
    [characters]
    -----END CERTIFICATE-----
    The top half is, of course, your private key. The bottom half is your server certificate. QNAP pushes these together to make stunnel.pem when you use the GUI to upload your SSL information.
  4. Type "a" in Putty, which will allow you to edit this file. Navigate to the bottom, just under ----END CERTIFICATE-----.
  5. Copy the entire contents of your intermediate certificate (you'll need to open it in Notepad or some other text editor to do this), and paste them into your Putty window.
  6. You should now have a file that looks like this:
    Code: Select all
    -----BEGIN RSA PRIVATE KEY-----
    [characters]
    -----END RSA PRIVATE KEY-----
    -----BEGIN CERTIFICATE-----
    [characters]
    -----END CERTIFICATE-----
    -----BEGIN CERTIFICATE-----
    [characters]
    -----END CERTIFICATE-----
  7. To save the file, press Esc (which exits edit mode), then type ":wq!", which saves and quits.
  8. Restart stunnel with this command:
    Code: Select all
    /etc/init.d/stunnel.sh restart

That should be it. You can test by using any browser to navigate to your site, or just use any online certificate checker, such as http://www.digicert.com/help.
pwnzicles
New here
 
Posts: 2
Joined: Tue Apr 17, 2012 10:13 am
NAS Model: TS-259 Pro

Re: SSL and Intermediate Certificates

Postby ilkevinli » Sun May 20, 2012 8:32 pm

I don't get any warnings when just using the Private and Server keys from my purchased certificate..
User avatar
ilkevinli
Starting out
 
Posts: 43
Joined: Thu Mar 22, 2012 1:24 am
NAS Model: TS-x19P II

Re: SSL and Intermediate Certificates

Postby uploader789 » Sun Aug 05, 2012 7:02 am

not working on my qnap ts 119 p2 :(
uploader789
New here
 
Posts: 2
Joined: Sat Jul 28, 2012 3:01 am
NAS Model: TS-109/209 Pro II

Re: SSL and Intermediate Certificates

Postby alvoryx » Wed Jan 30, 2013 2:32 am

you're the man, you saved my evening man.

without the intermediate, chrome and ie where working but not firefox.


for info, gandi.net offers for 12$ some SSL cert for 1 year

and there http://wiki.gandi.net/fr/ssl/intermediate you go for the intermediate key
alvoryx
Starting out
 
Posts: 16
Joined: Wed Oct 06, 2010 2:57 am
NAS Model: SS-439 Pro

Re: SSL and Intermediate Certificates

Postby ninio » Sat Feb 16, 2013 5:55 pm

Hello I'm trying to add the intermediate certificate but following the procedure continues to give me problems, it seems that it is not still sent
Does not pass the test of http://www.digicert.com/help. "The server is not sending the required intermediate certificate"
Is there a solution?
thanks
ninio
First post
 
Posts: 1
Joined: Sun Nov 18, 2012 9:47 pm
NAS Model: TS-x69U

Re: SSL and Intermediate Certificates

Postby schumaku » Mon Feb 18, 2013 9:54 pm

Everybody saying this does not work should be aware this is changing the NAS Admin Web server, not the NAS Web server.

Keep searching - there are hacks provided in the forum to make Apache providing the intermediate certificate, too.
User avatar
schumaku
Guru
 
Posts: 22583
Joined: Mon Jan 21, 2008 4:41 pm
Location: Kloten (Zurich), Switzerland -- Skype: schumaku
NAS Model: TS-x79 Pro


Return to Turbo Station Installation & Setup

Who is online

Users browsing this forum: No registered users and 2 guests