# Asus WRT Merlin HTTPs WebUI Cert... manual green padlock (July 2017)
#
# Your Merlin powered router can get a green padlock by simply using the 'generate new cert'
# option, and copy/trusting the cert found in (/jffs/ssl/cert.pem) to your OS.
# The purpose of this file is to learn the process the router uses, and allow more customization
# over the cert options. Plus, many embedded processors used in routers do not have good enough entropy
# to generate secure keypairs.
#
# Your Merlin powered router's cert generator script lies here:
# /usr/sbin/gencert.sh
# The script copies then modifies a config file you'll find here:
# /etc/openssl.cnf
#
# The below openssl config file is a typical example of what the script will use.
# It should be modified to match your configuration (the important lines to modify
# are near the bottom). Use this config, with the following 3 commands, to make
# certs and keys with openssl in Linux:
#
# openssl genrsa -out key.pem 4096 -config merlinWebUIcerts
# openssl req -new -x509 -key key.pem -sha256 -out cert.pem -days 3650 -config merlinWebUIcerts
# cat key.pem cert.pem > server.pem
#
# Verify the cert infos before putting it to use:
# openssl x509 -in /etc/cert.pem -text -noout
#
# Place the files in the /jffs/ssl/ directory and restart httpd (or reboot router).
# Copy cert.pem and rename to myRouterCert.crt. Distribute this cert to client(s) and
# add to their trusted root certs (see OS or browser docs on how to do this).
#
# For more info:
# https://www.snbforums.com/threads/user-provided-ssl-certificate-for-webui.40249/
#
#############################################################################
#Start Config File#
HOME = .
RANDFILE = $ENV::HOME/.rnd
oid_section = new_oids
[ new_oids ]
[ ca ]
default_ca = CA_default
[ CA_default ]
acopy_extensions = copy #script adds this
dir = /usr/share
certs = $dir/certs
crl_dir = $dir/crl
database = $dir/index.txt
new_certs_dir = $dir/newcerts
certificate = $dir/cacert.pem
serial = $dir/serial
crl = $dir/crl.pem
private_key = $dir/private/cakey.pem
RANDFILE = $dir/private/.rand
x509_extensions = usr_cert
default_days = 7305
default_crl_days = 30
default_md = md5
preserve = no
policy = policy_match
[ policy_match ]
countryName = match
stateOrProvinceName = match
organizationName = match
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ policy_anything ]
countryName = optional
stateOrProvinceName = optional
localityName = optional
organizationName = optional
organizationalUnitName = optional
commonName = supplied
emailAddress = optional
[ usr_cert ]
basicConstraints=CA:FALSE
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid,issuer:always
[ v3_req ]
subjectAltName = @alt_names #script adds this
basicConstraints = CA:FALSE
keyUsage = nonRepudiation, digitalSignature, keyEncipherment
[ v3_ca ]
subjectAltName = @alt_names #script adds this
subjectKeyIdentifier = hash
authorityKeyIdentifier = keyid:always,issuer:always
basicConstraints = CA:true
[ crl_ext ]
authorityKeyIdentifier = keyid:always,issuer:always
[ engine ]
default = openssl
[ req ]
default_bits = 2048
default_keyfile = privkey.pem
distinguished_name = req_distinguished_name
attributes = req_attributes
x509_extensions = v3_ca
string_mask = nombstr
req_extensions = v3_req
[ req_attributes ]
challengePassword = .
challengePassword_value =
unstructuredName = .
unstructuredName_value =
[ req_distinguished_name ]
countryName = .
countryName_value = US
stateOrProvinceName = .
stateOrProvinceName_value = .
localityName = .
localityName_value = .
organizationName = .
organizationName_value = .
organizationalUnitName = .
organizationalUnitName_value = .
#########################################################################
#Important things to modify below... mainly the .13.1 to your router IP, and RTN66R to your router name
0.commonName=CN
0.commonName_value=192.168.13.1 #your router's lan IP
0.organizationName=O
0.organizationName_value='ASUSWRT-Merlin'
#Add more like so if you use "Lan CN's"
#1.commonName=CN
#1.commonName_value=myLanCN1 #A lan CN
#1.organizationName=O
#1.organizationName_value='ASUSWRT-Merlin'
[alt_names]
IP.0 = 192.168.13.1 #your router's lan IP
DNS.0 = 192.168.13.1 #your router's lan IP (for dumb browsers)
DNS.1 = router.asus.com #yeeeeeeup!
DNS.2 = RTN66R #my old router, yours is probably different
DNS.3 = RTN66R.home #I use "home" as my LAN domain
DNS.4 = yourUserName.asuscomm.com #Not sure this is needed, but I use DDNS for Openvpn, and this was in my cert.
#DNS.5 = addYourLanCNsIfYouUseThose