Pārlūkot izejas kodu

Simplify the certificate renewal instructions

Bob Mottram 10 gadus atpakaļ
vecāks
revīzija
cedbc11e15
2 mainītis faili ar 23 papildinājumiem un 161 dzēšanām
  1. 11
    69
      doc/EN/faq.org
  2. 12
    92
      website/EN/faq.html

+ 11
- 69
doc/EN/faq.org Parādīt failu

@@ -274,91 +274,33 @@ Now go to [[startssl.com]] and click on the keys icon on the right hand side to
274 274
 
275 275
 Once your email is validated then go to *Validations Wizard* and choose *Domain name validation*. Enter your domain name and select *postmaster@yourdomainname*. After a while you should receive a validation email and you can then enter the code.
276 276
 
277
-Log into the Freedombone and become the root user. Now we can generate a new certificate request as follows.
277
+Log in to the Freedombone, become the root user, then issue the renew command:
278 278
 
279 279
 #+BEGIN_SRC bash
280
-export HOSTNAME=mydomainname.com
281
-openssl genrsa -out /etc/ssl/private/$HOSTNAME.new.key 2048
282
-chown root:ssl-cert /etc/ssl/private/$HOSTNAME.new.key
283
-chmod 440 /etc/ssl/private/$HOSTNAME.new.key
284
-mkdir /etc/ssl/requests
285
-#+END_SRC
286
-
287
-Now make a certificate request as follows.  You should copy and paste the whole of this, not just line by line.
288
-
289
-#+BEGIN_SRC bash
290
-openssl req -new -sha256 -key /etc/ssl/private/$HOSTNAME.new.key -out /etc/ssl/requests/$HOSTNAME.csr
280
+ssh username@mydomainname -p 2222
281
+su
282
+freedombone-renew-cert -h mydomainname
291 283
 #+END_SRC
292 284
 
293
-For the email address it's a good idea to use postmaster@mydomainname.
285
+For the email address it's a good idea to use /postmaster@mydomainname/.
294 286
 
295 287
 Use a random 20 character password, and keep a note of it.  We'll remove this later.
296 288
 
297
-View the request with:
298
-
299
-#+BEGIN_SRC bash
300
-cat /etc/ssl/requests/$HOSTNAME.csr
301
-#+END_SRC
302
-
303
-On the StartSSL site select *Certificates Wizard* then *Web server SSL/TLS Certificate*. You can then click on "skip" and then copy and paste the encrypted request into the text entry box. You may now need to wait a few hours for a confirmation email indicating that the new certificate was created.
289
+On the StartSSL site select *Certificates Wizard* then *Web server SSL/TLS Certificate*. You can then click on "skip" and then copy and paste the certificate request into the text entry box. You may now need to wait a few hours for a confirmation email indicating that the new certificate was created.
304 290
 
305
-Select *Tool Box* and then *Retrieve Certificate* from the list. Make sure to choose the one with the correct expiration date.  Copy the text.
291
+Select *Tool Box* and then *Retrieve Certificate* from the list. Make sure to choose the one with the correct expiration date.  Copy the text, then on the Freedombone.
306 292
 
307 293
 #+BEGIN_SRC bash
308
-mv /etc/ssl/private/$HOSTNAME.new.key /etc/ssl/private/$HOSTNAME.key
309
-editor /etc/ssl/certs/$HOSTNAME.crt
294
+editor /etc/ssl/certs/mydomainname.new.crt
310 295
 #+END_SRC
311 296
 
312
-Delete any existing contents then paste the public key from the StartSSL site. Save and exit.  Then run the following commands:
297
+Paste the public key from the StartSSL site. Save and exit.  Then run the renew command again:
313 298
 
314 299
 #+BEGIN_SRC bash
315
-mkdir /etc/ssl/roots
316
-mkdir /etc/ssl/chains
317
-wget "http://www.startssl.com/certs/ca.pem" --output-document="/etc/ssl/roots/startssl-root.ca"
318
-wget "http://www.startssl.com/certs/sub.class1.server.ca.pem" --output-document="/etc/ssl/chains/startssl-sub.class1.server.ca.pem"
319
-wget "http://www.startssl.com/certs/sub.class2.server.ca.pem" --output-document="/etc/ssl/chains/startssl-sub.class2.server.ca.pem"
320
-wget "http://www.startssl.com/certs/sub.class3.server.ca.pem" --output-document="/etc/ssl/chains/startssl-sub.class3.server.ca.pem"
321
-ln -s "/etc/ssl/roots/startssl-root.ca" "/etc/ssl/roots/$HOSTNAME-root.ca"
322
-ln -s "/etc/ssl/chains/startssl-sub.class1.server.ca.pem" "/etc/ssl/chains/$HOSTNAME.ca"
323
-cp "/etc/ssl/certs/$HOSTNAME.crt" "/etc/ssl/certs/$HOSTNAME.crt+chain+root"
324
-test -e "/etc/ssl/chains/$HOSTNAME.ca" && cat "/etc/ssl/chains/$HOSTNAME.ca" >> "/etc/ssl/certs/$HOSTNAME.crt+chain+root"
325
-test -e "/etc/ssl/roots/$HOSTNAME-root.ca" && cat "/etc/ssl/roots/$HOSTNAME-root.ca" >> "/etc/ssl/certs/$HOSTNAME.crt+chain+root"
326
-#+END_SRC
327
-
328
-Remove the certificate password, so if the server is rebooted then it won't wait indefinitely for a non-existant keyboard user to type in a password.
329
-
330
-#+BEGIN_SRC bash
331
-openssl rsa -in /etc/ssl/private/$HOSTNAME.key -out /etc/ssl/private/$HOSTNAME.new.key
332
-cp /etc/ssl/private/$HOSTNAME.new.key /etc/ssl/private/$HOSTNAME.key
333
-shred -zu /etc/ssl/private/$HOSTNAME.new.key
334
-#+END_SRC
335
-
336
-Create a bundled certificate which joins the certificate and chain file together.
337
-
338
-#+BEGIN_SRC bash
339
-cat /etc/ssl/certs/$HOSTNAME.crt /etc/ssl/chains/startssl-sub.class1.server.ca.pem > /etc/ssl/certs/$HOSTNAME.bundle.crt
340
-#+END_SRC
341
-
342
-And also add it to the overall bundle of certificates for the Freedombone. This will allow you to easily install the certificates onto other systems.
343
-
344
-#+BEGIN_SRC bash
345
-cp /etc/ssl/certs/$HOSTNAME.bundle.crt /etc/ssl/mycerts
346
-cat /etc/ssl/mycerts/*.crt > /etc/ssl/freedombone-bundle.crt
347
-tar -czvf /etc/ssl/freedombone-certs.tar.gz /etc/ssl/mycerts/*.crt
348
-#+END_SRC
349
-
350
-To avoid any possibility of the certificates being accidentally overwritten by self-signed ones at a later date you can create backups.
351
-
352
-#+BEGIN_SRC bash
353
-mkdir /etc/ssl/backups
354
-mkdir /etc/ssl/backups/certs
355
-mkdir /etc/ssl/backups/private
356
-cp /etc/ssl/certs/$HOSTNAME* /etc/ssl/backups/certs/
357
-cp /etc/ssl/private/$HOSTNAME* /etc/ssl/backups/private/
358
-chmod -R 400 /etc/ssl/backups/certs/*
359
-chmod -R 400 /etc/ssl/backups/private/*
300
+freedombone-renew-cert -h mydomainname
360 301
 #+END_SRC
361 302
 
303
+The new certificate will then be installed.
362 304
 * Why use self-signed certificates?
363 305
 Almost everywhere on the web you will read that self-signed certificates are worthless. They bring up scary looking browser warnings and gurus will advise you not to use them. Self-signed certificates are quite useful though. What the scary warnings mean - and it would be good if they explained this more clearly - is that you have an encrypted connection established but there is /no certainty about who that connection is with/. The usual solution to this is to get a "real" SSL certificate from one of the certificate authorities, but it's far from clear that such authorities can be trusted. There have been various scandals involving such organisations, and it does not seem plausible to assume that they are somehow immune to the sort of treatment which [[http://en.wikipedia.org/wiki/Lavabit][Lavabit]] received. So although most internet users have been trained to look for the lock icon as an indication that the connection is secured that belief may not always be well founded.
364 306
 

+ 12
- 92
website/EN/faq.html Parādīt failu

@@ -4,7 +4,7 @@
4 4
 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
5 5
 <head>
6 6
 <title></title>
7
-<!-- 2015-03-23 Mon 20:14 -->
7
+<!-- 2015-04-03 Fri 18:38 -->
8 8
 <meta  http-equiv="Content-Type" content="text/html;charset=utf-8" />
9 9
 <meta  name="generator" content="Org-mode" />
10 10
 <meta  name="author" content="Bob Mottram" />
@@ -630,31 +630,19 @@ Once your email is validated then go to <b>Validations Wizard</b> and choose <b>
630 630
 </p>
631 631
 
632 632
 <p>
633
-Log into the Freedombone and become the root user. Now we can generate a new certificate request as follows.
633
+Log in to the Freedombone, become the root user, then issue the renew command:
634 634
 </p>
635 635
 
636 636
 <div class="org-src-container">
637 637
 
638
-<pre class="src src-bash"><span class="org-builtin">export</span> <span class="org-variable-name">HOSTNAME</span>=mydomainname.com
639
-openssl genrsa -out /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key 2048
640
-chown root:ssl-cert /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key
641
-chmod 440 /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key
642
-mkdir /etc/ssl/requests
643
-</pre>
644
-</div>
645
-
646
-<p>
647
-Now make a certificate request as follows.  You should copy and paste the whole of this, not just line by line.
648
-</p>
649
-
650
-<div class="org-src-container">
651
-
652
-<pre class="src src-bash">openssl req -new -sha256 -key /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key -out /etc/ssl/requests/$<span class="org-variable-name">HOSTNAME</span>.csr
638
+<pre class="src src-bash">ssh username@mydomainname -p 2222
639
+su
640
+freedombone-renew-cert -h mydomainname
653 641
 </pre>
654 642
 </div>
655 643
 
656 644
 <p>
657
-For the email address it's a good idea to use postmaster@mydomainname.
645
+For the email address it's a good idea to use <i>postmaster@mydomainname</i>.
658 646
 </p>
659 647
 
660 648
 <p>
@@ -662,102 +650,34 @@ Use a random 20 character password, and keep a note of it.  We'll remove this la
662 650
 </p>
663 651
 
664 652
 <p>
665
-View the request with:
653
+On the StartSSL site select <b>Certificates Wizard</b> then <b>Web server SSL/TLS Certificate</b>. You can then click on "skip" and then copy and paste the certificate request into the text entry box. You may now need to wait a few hours for a confirmation email indicating that the new certificate was created.
666 654
 </p>
667 655
 
668
-<div class="org-src-container">
669
-
670
-<pre class="src src-bash">cat /etc/ssl/requests/$<span class="org-variable-name">HOSTNAME</span>.csr
671
-</pre>
672
-</div>
673
-
674 656
 <p>
675
-On the StartSSL site select <b>Certificates Wizard</b> then <b>Web server SSL/TLS Certificate</b>. You can then click on "skip" and then copy and paste the encrypted request into the text entry box. You may now need to wait a few hours for a confirmation email indicating that the new certificate was created.
676
-</p>
677
-
678
-<p>
679
-Select <b>Tool Box</b> and then <b>Retrieve Certificate</b> from the list. Make sure to choose the one with the correct expiration date.  Copy the text.
657
+Select <b>Tool Box</b> and then <b>Retrieve Certificate</b> from the list. Make sure to choose the one with the correct expiration date.  Copy the text, then on the Freedombone.
680 658
 </p>
681 659
 
682 660
 <div class="org-src-container">
683 661
 
684
-<pre class="src src-bash">mv /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.key
685
-editor /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>.crt
662
+<pre class="src src-bash">editor /etc/ssl/certs/mydomainname.new.crt
686 663
 </pre>
687 664
 </div>
688 665
 
689 666
 <p>
690
-Delete any existing contents then paste the public key from the StartSSL site. Save and exit.  Then run the following commands:
667
+Paste the public key from the StartSSL site. Save and exit.  Then run the renew command again:
691 668
 </p>
692 669
 
693 670
 <div class="org-src-container">
694 671
 
695
-<pre class="src src-bash">mkdir /etc/ssl/roots
696
-mkdir /etc/ssl/chains
697
-wget <span class="org-string">"http://www.startssl.com/certs/ca.pem"</span> --output-document=<span class="org-string">"/etc/ssl/roots/startssl-root.ca"</span>
698
-wget <span class="org-string">"http://www.startssl.com/certs/sub.class1.server.ca.pem"</span> --output-document=<span class="org-string">"/etc/ssl/chains/startssl-sub.class1.server.ca.pem"</span>
699
-wget <span class="org-string">"http://www.startssl.com/certs/sub.class2.server.ca.pem"</span> --output-document=<span class="org-string">"/etc/ssl/chains/startssl-sub.class2.server.ca.pem"</span>
700
-wget <span class="org-string">"http://www.startssl.com/certs/sub.class3.server.ca.pem"</span> --output-document=<span class="org-string">"/etc/ssl/chains/startssl-sub.class3.server.ca.pem"</span>
701
-ln -s <span class="org-string">"/etc/ssl/roots/startssl-root.ca"</span> <span class="org-string">"/etc/ssl/roots/$HOSTNAME-root.ca"</span>
702
-ln -s <span class="org-string">"/etc/ssl/chains/startssl-sub.class1.server.ca.pem"</span> <span class="org-string">"/etc/ssl/chains/$HOSTNAME.ca"</span>
703
-cp <span class="org-string">"/etc/ssl/certs/$HOSTNAME.crt"</span> <span class="org-string">"/etc/ssl/certs/$HOSTNAME.crt+chain+root"</span>
704
-<span class="org-builtin">test</span> -e <span class="org-string">"/etc/ssl/chains/$HOSTNAME.ca"</span> &amp;&amp; cat <span class="org-string">"/etc/ssl/chains/$HOSTNAME.ca"</span> &gt;&gt; <span class="org-string">"/etc/ssl/certs/$HOSTNAME.crt+chain+root"</span>
705
-<span class="org-builtin">test</span> -e <span class="org-string">"/etc/ssl/roots/$HOSTNAME-root.ca"</span> &amp;&amp; cat <span class="org-string">"/etc/ssl/roots/$HOSTNAME-root.ca"</span> &gt;&gt; <span class="org-string">"/etc/ssl/certs/$HOSTNAME.crt+chain+root"</span>
672
+<pre class="src src-bash">freedombone-renew-cert -h mydomainname
706 673
 </pre>
707 674
 </div>
708 675
 
709 676
 <p>
710
-Remove the certificate password, so if the server is rebooted then it won't wait indefinitely for a non-existant keyboard user to type in a password.
677
+The new certificate will then be installed.
711 678
 </p>
712
-
713
-<div class="org-src-container">
714
-
715
-<pre class="src src-bash">openssl rsa -in /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.key -out /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key
716
-cp /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.key
717
-shred -zu /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>.new.key
718
-</pre>
719
-</div>
720
-
721
-<p>
722
-Create a bundled certificate which joins the certificate and chain file together.
723
-</p>
724
-
725
-<div class="org-src-container">
726
-
727
-<pre class="src src-bash">cat /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>.crt /etc/ssl/chains/startssl-sub.class1.server.ca.pem &gt; /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>.bundle.crt
728
-</pre>
729
-</div>
730
-
731
-<p>
732
-And also add it to the overall bundle of certificates for the Freedombone. This will allow you to easily install the certificates onto other systems.
733
-</p>
734
-
735
-<div class="org-src-container">
736
-
737
-<pre class="src src-bash">cp /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>.bundle.crt /etc/ssl/mycerts
738
-cat /etc/ssl/mycerts/*.crt &gt; /etc/ssl/freedombone-bundle.crt
739
-tar -czvf /etc/ssl/freedombone-certs.tar.gz /etc/ssl/mycerts/*.crt
740
-</pre>
741
-</div>
742
-
743
-<p>
744
-To avoid any possibility of the certificates being accidentally overwritten by self-signed ones at a later date you can create backups.
745
-</p>
746
-
747
-<div class="org-src-container">
748
-
749
-<pre class="src src-bash">mkdir /etc/ssl/backups
750
-mkdir /etc/ssl/backups/certs
751
-mkdir /etc/ssl/backups/private
752
-cp /etc/ssl/certs/$<span class="org-variable-name">HOSTNAME</span>* /etc/ssl/backups/certs/
753
-cp /etc/ssl/private/$<span class="org-variable-name">HOSTNAME</span>* /etc/ssl/backups/private/
754
-chmod -R 400 /etc/ssl/backups/certs/*
755
-chmod -R 400 /etc/ssl/backups/private/*
756
-</pre>
757 679
 </div>
758 680
 </div>
759
-</div>
760
-
761 681
 <div id="outline-container-unnumbered-10" class="outline-2">
762 682
 <h2 id="unnumbered-10">Why use self-signed certificates?</h2>
763 683
 <div class="outline-text-2" id="text-unnumbered-10">