The cert "bootstrap" code now checks certs for validity
authorAlan T. DeKok <aland@freeradius.org>
Sat, 23 Oct 2010 06:57:58 +0000 (08:57 +0200)
committerAlan T. DeKok <aland@freeradius.org>
Sat, 23 Oct 2010 19:17:39 +0000 (21:17 +0200)
Otherwise, the server can load expired certificates.  The clients will
refuse to connect, via the usual "access-challenge followed by nothing"
issue.  A better approach is for the server to print an error message
on startup, and refuse to run.

raddb/certs/Makefile
raddb/certs/bootstrap
raddb/eap.conf

index b0e2973..5a91002 100644 (file)
@@ -36,7 +36,7 @@ client: client.pem
 ca: ca.der
 
 .PHONY: server
-server: server.pem
+server: server.pem server.vrfy
 
 ######################################################################
 #
index f76a84f..e70b506 100755 (executable)
@@ -66,6 +66,7 @@ fi
 
 if [ ! -f server.pem ]; then
   openssl pkcs12 -in server.p12 -out server.pem -passin pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` -passout pass:`grep output_password server.cnf | sed 's/.*=//;s/^ *//'` || exit 1
+  openssl verify -CAfile ca.pem server.pem || exit 1
 fi
 
 if [ ! -f ca.der ]; then
index 998b1b5..941ebe9 100644 (file)
 
                        #
 
-                       #  This configuration entry should be deleted
-                       #  once the server is running in a normal
-                       #  configuration.  It is here ONLY to make
-                       #  initial deployments easier.
+                       # This command creates the initial "snake oil"
+                       # certificates when the server is run as root,
+                       # and via "radiusd -X".
+                       #
+                       # As of 2.1.11, it *also* checks the server
+                       # certificate for validity, including expiration.
+                       # This means that radiusd will refuse to start
+                       # when the certificate has expired.  The alternative
+                       # is to have the 802.1X clients refuse to connect
+                       # when they discover the certificate has expired.
+                       #
+                       # Debugging client issues is hard, so it's better
+                       # for the server to print out an error message,
+                       # and refuse to start.
                        #
                        make_cert_command = "${certdir}/bootstrap"
 
                        # see doc/SoH.txt for more info.
                        # It is disabled by default.
                        #
-               #       soh = yes
+#                      soh = yes
 
                        #
                        # The SoH reply will be turned into a request which
                        # can be sent to a specific virtual server:
                        #
-               #       soh_virtual_server = "soh-server"
+#                      soh_virtual_server = "soh-server"
                }
 
                #