diff --git a/sample/sample-keys/gen-sample-keys.sh b/sample/sample-keys/gen-sample-keys.sh
index e5a11f5..e914fd2 100755
--- a/sample/sample-keys/gen-sample-keys.sh
+++ b/sample/sample-keys/gen-sample-keys.sh
@@ -22,7 +22,6 @@
 mkdir -p sample-ca
 rm -f sample-ca/index.txt
 touch sample-ca/index.txt
-echo "01" > sample-ca/serial
 
 # Generate CA key and cert
 openssl req -new -newkey rsa:4096 -days 3650 -nodes -x509 \
diff --git a/sample/sample-keys/openssl.cnf b/sample/sample-keys/openssl.cnf
index 02bf8ac..dcaebb7 100644
--- a/sample/sample-keys/openssl.cnf
+++ b/sample/sample-keys/openssl.cnf
@@ -14,7 +14,7 @@
 new_certs_dir	= $dir			# default place for new certs.
 
 certificate	= $dir/ca.crt	 	# The CA certificate
-serial		= $dir/serial 		# The current serial number
+rand_serial	= yes			# Use random serial numbers
 crl		= $dir/crl.pem 		# The current CRL
 private_key	= $dir/ca.key		# The private key
 RANDFILE	= $dir/.rand		# private random number file
