10Sstevel@tonic-gate# 20Sstevel@tonic-gate# OpenSSL example configuration file. 30Sstevel@tonic-gate# This is mostly being used for generation of certificate requests. 40Sstevel@tonic-gate# 50Sstevel@tonic-gate 60Sstevel@tonic-gate# This definition stops the following lines choking if HOME isn't 70Sstevel@tonic-gate# defined. 80Sstevel@tonic-gateHOME = . 90Sstevel@tonic-gateRANDFILE = $ENV::HOME/.rnd 100Sstevel@tonic-gate 110Sstevel@tonic-gate# Extra OBJECT IDENTIFIER info: 120Sstevel@tonic-gate#oid_file = $ENV::HOME/.oid 130Sstevel@tonic-gateoid_section = new_oids 140Sstevel@tonic-gate 150Sstevel@tonic-gate# To use this configuration file with the "-extfile" option of the 160Sstevel@tonic-gate# "openssl x509" utility, name here the section containing the 170Sstevel@tonic-gate# X.509v3 extensions to use: 180Sstevel@tonic-gate# extensions = 190Sstevel@tonic-gate# (Alternatively, use a configuration file that has only 200Sstevel@tonic-gate# X.509v3 extensions in its main [= default] section.) 210Sstevel@tonic-gate 220Sstevel@tonic-gate[ new_oids ] 230Sstevel@tonic-gate 240Sstevel@tonic-gate# We can add new OIDs in here for use by 'ca' and 'req'. 250Sstevel@tonic-gate# Add a simple OID like this: 260Sstevel@tonic-gate# testoid1=1.2.3.4 270Sstevel@tonic-gate# Or use config file substitution like this: 280Sstevel@tonic-gate# testoid2=${testoid1}.5.6 290Sstevel@tonic-gate 300Sstevel@tonic-gate#################################################################### 310Sstevel@tonic-gate[ ca ] 320Sstevel@tonic-gatedefault_ca = CA_default # The default ca section 330Sstevel@tonic-gate 340Sstevel@tonic-gate#################################################################### 350Sstevel@tonic-gate[ CA_default ] 360Sstevel@tonic-gate 370Sstevel@tonic-gatedir = ./demoCA # Where everything is kept 380Sstevel@tonic-gatecerts = $dir/certs # Where the issued certs are kept 390Sstevel@tonic-gatecrl_dir = $dir/crl # Where the issued crl are kept 400Sstevel@tonic-gatedatabase = $dir/index.txt # database index file. 410Sstevel@tonic-gate#unique_subject = no # Set to 'no' to allow creation of 420Sstevel@tonic-gate # several ctificates with same subject. 430Sstevel@tonic-gatenew_certs_dir = $dir/newcerts # default place for new certs. 440Sstevel@tonic-gate 450Sstevel@tonic-gatecertificate = $dir/cacert.pem # The CA certificate 460Sstevel@tonic-gateserial = $dir/serial # The current serial number 47*2139Sjp161948crlnumber = $dir/crlnumber # the current crl number 480Sstevel@tonic-gate # must be commented out to leave a V1 CRL 490Sstevel@tonic-gatecrl = $dir/crl.pem # The current CRL 500Sstevel@tonic-gateprivate_key = $dir/private/cakey.pem# The private key 510Sstevel@tonic-gateRANDFILE = $dir/private/.rand # private random number file 520Sstevel@tonic-gate 530Sstevel@tonic-gatex509_extensions = usr_cert # The extentions to add to the cert 540Sstevel@tonic-gate 550Sstevel@tonic-gate# Comment out the following two lines for the "traditional" 560Sstevel@tonic-gate# (and highly broken) format. 570Sstevel@tonic-gatename_opt = ca_default # Subject Name options 580Sstevel@tonic-gatecert_opt = ca_default # Certificate field options 590Sstevel@tonic-gate 600Sstevel@tonic-gate# Extension copying option: use with caution. 610Sstevel@tonic-gate# copy_extensions = copy 620Sstevel@tonic-gate 630Sstevel@tonic-gate# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs 640Sstevel@tonic-gate# so this is commented out by default to leave a V1 CRL. 650Sstevel@tonic-gate# crlnumber must also be commented out to leave a V1 CRL. 660Sstevel@tonic-gate# crl_extensions = crl_ext 670Sstevel@tonic-gate 680Sstevel@tonic-gatedefault_days = 365 # how long to certify for 690Sstevel@tonic-gatedefault_crl_days= 30 # how long before next CRL 70*2139Sjp161948default_md = sha1 # which md to use. 710Sstevel@tonic-gatepreserve = no # keep passed DN ordering 720Sstevel@tonic-gate 730Sstevel@tonic-gate# A few difference way of specifying how similar the request should look 740Sstevel@tonic-gate# For type CA, the listed attributes must be the same, and the optional 750Sstevel@tonic-gate# and supplied fields are just that :-) 760Sstevel@tonic-gatepolicy = policy_match 770Sstevel@tonic-gate 780Sstevel@tonic-gate# For the CA policy 790Sstevel@tonic-gate[ policy_match ] 800Sstevel@tonic-gatecountryName = match 810Sstevel@tonic-gatestateOrProvinceName = match 820Sstevel@tonic-gateorganizationName = match 830Sstevel@tonic-gateorganizationalUnitName = optional 840Sstevel@tonic-gatecommonName = supplied 850Sstevel@tonic-gateemailAddress = optional 860Sstevel@tonic-gate 870Sstevel@tonic-gate# For the 'anything' policy 880Sstevel@tonic-gate# At this point in time, you must list all acceptable 'object' 890Sstevel@tonic-gate# types. 900Sstevel@tonic-gate[ policy_anything ] 910Sstevel@tonic-gatecountryName = optional 920Sstevel@tonic-gatestateOrProvinceName = optional 930Sstevel@tonic-gatelocalityName = optional 940Sstevel@tonic-gateorganizationName = optional 950Sstevel@tonic-gateorganizationalUnitName = optional 960Sstevel@tonic-gatecommonName = supplied 970Sstevel@tonic-gateemailAddress = optional 980Sstevel@tonic-gate 990Sstevel@tonic-gate#################################################################### 1000Sstevel@tonic-gate[ req ] 1010Sstevel@tonic-gatedefault_bits = 1024 1020Sstevel@tonic-gatedefault_keyfile = privkey.pem 1030Sstevel@tonic-gatedistinguished_name = req_distinguished_name 1040Sstevel@tonic-gateattributes = req_attributes 1050Sstevel@tonic-gatex509_extensions = v3_ca # The extentions to add to the self signed cert 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate# Passwords for private keys if not present they will be prompted for 1080Sstevel@tonic-gate# input_password = secret 1090Sstevel@tonic-gate# output_password = secret 1100Sstevel@tonic-gate 1110Sstevel@tonic-gate# This sets a mask for permitted string types. There are several options. 1120Sstevel@tonic-gate# default: PrintableString, T61String, BMPString. 1130Sstevel@tonic-gate# pkix : PrintableString, BMPString. 1140Sstevel@tonic-gate# utf8only: only UTF8Strings. 1150Sstevel@tonic-gate# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). 1160Sstevel@tonic-gate# MASK:XXXX a literal mask value. 1170Sstevel@tonic-gate# WARNING: current versions of Netscape crash on BMPStrings or UTF8Strings 1180Sstevel@tonic-gate# so use this option with caution! 1190Sstevel@tonic-gatestring_mask = nombstr 1200Sstevel@tonic-gate 1210Sstevel@tonic-gate# req_extensions = v3_req # The extensions to add to a certificate request 1220Sstevel@tonic-gate 1230Sstevel@tonic-gate[ req_distinguished_name ] 1240Sstevel@tonic-gatecountryName = Country Name (2 letter code) 1250Sstevel@tonic-gatecountryName_default = AU 1260Sstevel@tonic-gatecountryName_min = 2 1270Sstevel@tonic-gatecountryName_max = 2 1280Sstevel@tonic-gate 1290Sstevel@tonic-gatestateOrProvinceName = State or Province Name (full name) 1300Sstevel@tonic-gatestateOrProvinceName_default = Some-State 1310Sstevel@tonic-gate 1320Sstevel@tonic-gatelocalityName = Locality Name (eg, city) 1330Sstevel@tonic-gate 1340Sstevel@tonic-gate0.organizationName = Organization Name (eg, company) 1350Sstevel@tonic-gate0.organizationName_default = Internet Widgits Pty Ltd 1360Sstevel@tonic-gate 1370Sstevel@tonic-gate# we can do this but it is not needed normally :-) 1380Sstevel@tonic-gate#1.organizationName = Second Organization Name (eg, company) 1390Sstevel@tonic-gate#1.organizationName_default = World Wide Web Pty Ltd 1400Sstevel@tonic-gate 1410Sstevel@tonic-gateorganizationalUnitName = Organizational Unit Name (eg, section) 1420Sstevel@tonic-gate#organizationalUnitName_default = 1430Sstevel@tonic-gate 1440Sstevel@tonic-gatecommonName = Common Name (eg, YOUR name) 1450Sstevel@tonic-gatecommonName_max = 64 1460Sstevel@tonic-gate 1470Sstevel@tonic-gateemailAddress = Email Address 1480Sstevel@tonic-gateemailAddress_max = 64 1490Sstevel@tonic-gate 1500Sstevel@tonic-gate# SET-ex3 = SET extension number 3 1510Sstevel@tonic-gate 1520Sstevel@tonic-gate[ req_attributes ] 1530Sstevel@tonic-gatechallengePassword = A challenge password 1540Sstevel@tonic-gatechallengePassword_min = 4 1550Sstevel@tonic-gatechallengePassword_max = 20 1560Sstevel@tonic-gate 1570Sstevel@tonic-gateunstructuredName = An optional company name 1580Sstevel@tonic-gate 1590Sstevel@tonic-gate[ usr_cert ] 1600Sstevel@tonic-gate 1610Sstevel@tonic-gate# These extensions are added when 'ca' signs a request. 1620Sstevel@tonic-gate 1630Sstevel@tonic-gate# This goes against PKIX guidelines but some CAs do it and some software 1640Sstevel@tonic-gate# requires this to avoid interpreting an end user certificate as a CA. 1650Sstevel@tonic-gate 1660Sstevel@tonic-gatebasicConstraints=CA:FALSE 1670Sstevel@tonic-gate 1680Sstevel@tonic-gate# Here are some examples of the usage of nsCertType. If it is omitted 1690Sstevel@tonic-gate# the certificate can be used for anything *except* object signing. 1700Sstevel@tonic-gate 1710Sstevel@tonic-gate# This is OK for an SSL server. 1720Sstevel@tonic-gate# nsCertType = server 1730Sstevel@tonic-gate 1740Sstevel@tonic-gate# For an object signing certificate this would be used. 1750Sstevel@tonic-gate# nsCertType = objsign 1760Sstevel@tonic-gate 1770Sstevel@tonic-gate# For normal client use this is typical 1780Sstevel@tonic-gate# nsCertType = client, email 1790Sstevel@tonic-gate 1800Sstevel@tonic-gate# and for everything including object signing: 1810Sstevel@tonic-gate# nsCertType = client, email, objsign 1820Sstevel@tonic-gate 1830Sstevel@tonic-gate# This is typical in keyUsage for a client certificate. 1840Sstevel@tonic-gate# keyUsage = nonRepudiation, digitalSignature, keyEncipherment 1850Sstevel@tonic-gate 1860Sstevel@tonic-gate# This will be displayed in Netscape's comment listbox. 1870Sstevel@tonic-gatensComment = "OpenSSL Generated Certificate" 1880Sstevel@tonic-gate 1890Sstevel@tonic-gate# PKIX recommendations harmless if included in all certificates. 1900Sstevel@tonic-gatesubjectKeyIdentifier=hash 191*2139Sjp161948authorityKeyIdentifier=keyid,issuer 1920Sstevel@tonic-gate 1930Sstevel@tonic-gate# This stuff is for subjectAltName and issuerAltname. 1940Sstevel@tonic-gate# Import the email address. 1950Sstevel@tonic-gate# subjectAltName=email:copy 1960Sstevel@tonic-gate# An alternative to produce certificates that aren't 1970Sstevel@tonic-gate# deprecated according to PKIX. 1980Sstevel@tonic-gate# subjectAltName=email:move 1990Sstevel@tonic-gate 2000Sstevel@tonic-gate# Copy subject details 2010Sstevel@tonic-gate# issuerAltName=issuer:copy 2020Sstevel@tonic-gate 2030Sstevel@tonic-gate#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem 2040Sstevel@tonic-gate#nsBaseUrl 2050Sstevel@tonic-gate#nsRevocationUrl 2060Sstevel@tonic-gate#nsRenewalUrl 2070Sstevel@tonic-gate#nsCaPolicyUrl 2080Sstevel@tonic-gate#nsSslServerName 2090Sstevel@tonic-gate 2100Sstevel@tonic-gate[ v3_req ] 2110Sstevel@tonic-gate 2120Sstevel@tonic-gate# Extensions to add to a certificate request 2130Sstevel@tonic-gate 2140Sstevel@tonic-gatebasicConstraints = CA:FALSE 2150Sstevel@tonic-gatekeyUsage = nonRepudiation, digitalSignature, keyEncipherment 2160Sstevel@tonic-gate 2170Sstevel@tonic-gate[ v3_ca ] 2180Sstevel@tonic-gate 2190Sstevel@tonic-gate 2200Sstevel@tonic-gate# Extensions for a typical CA 2210Sstevel@tonic-gate 2220Sstevel@tonic-gate 2230Sstevel@tonic-gate# PKIX recommendation. 2240Sstevel@tonic-gate 2250Sstevel@tonic-gatesubjectKeyIdentifier=hash 2260Sstevel@tonic-gate 2270Sstevel@tonic-gateauthorityKeyIdentifier=keyid:always,issuer:always 2280Sstevel@tonic-gate 2290Sstevel@tonic-gate# This is what PKIX recommends but some broken software chokes on critical 2300Sstevel@tonic-gate# extensions. 2310Sstevel@tonic-gate#basicConstraints = critical,CA:true 2320Sstevel@tonic-gate# So we do this instead. 2330Sstevel@tonic-gatebasicConstraints = CA:true 2340Sstevel@tonic-gate 2350Sstevel@tonic-gate# Key usage: this is typical for a CA certificate. However since it will 2360Sstevel@tonic-gate# prevent it being used as an test self-signed certificate it is best 2370Sstevel@tonic-gate# left out by default. 2380Sstevel@tonic-gate# keyUsage = cRLSign, keyCertSign 2390Sstevel@tonic-gate 2400Sstevel@tonic-gate# Some might want this also 2410Sstevel@tonic-gate# nsCertType = sslCA, emailCA 2420Sstevel@tonic-gate 2430Sstevel@tonic-gate# Include email address in subject alt name: another PKIX recommendation 2440Sstevel@tonic-gate# subjectAltName=email:copy 2450Sstevel@tonic-gate# Copy issuer details 2460Sstevel@tonic-gate# issuerAltName=issuer:copy 2470Sstevel@tonic-gate 2480Sstevel@tonic-gate# DER hex encoding of an extension: beware experts only! 2490Sstevel@tonic-gate# obj=DER:02:03 2500Sstevel@tonic-gate# Where 'obj' is a standard or added object 2510Sstevel@tonic-gate# You can even override a supported extension: 2520Sstevel@tonic-gate# basicConstraints= critical, DER:30:03:01:01:FF 2530Sstevel@tonic-gate 2540Sstevel@tonic-gate[ crl_ext ] 2550Sstevel@tonic-gate 2560Sstevel@tonic-gate# CRL extensions. 2570Sstevel@tonic-gate# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. 2580Sstevel@tonic-gate 2590Sstevel@tonic-gate# issuerAltName=issuer:copy 2600Sstevel@tonic-gateauthorityKeyIdentifier=keyid:always,issuer:always 261*2139Sjp161948 262*2139Sjp161948[ proxy_cert_ext ] 263*2139Sjp161948# These extensions should be added when creating a proxy certificate 264*2139Sjp161948 265*2139Sjp161948# This goes against PKIX guidelines but some CAs do it and some software 266*2139Sjp161948# requires this to avoid interpreting an end user certificate as a CA. 267*2139Sjp161948 268*2139Sjp161948basicConstraints=CA:FALSE 269*2139Sjp161948 270*2139Sjp161948# Here are some examples of the usage of nsCertType. If it is omitted 271*2139Sjp161948# the certificate can be used for anything *except* object signing. 272*2139Sjp161948 273*2139Sjp161948# This is OK for an SSL server. 274*2139Sjp161948# nsCertType = server 275*2139Sjp161948 276*2139Sjp161948# For an object signing certificate this would be used. 277*2139Sjp161948# nsCertType = objsign 278*2139Sjp161948 279*2139Sjp161948# For normal client use this is typical 280*2139Sjp161948# nsCertType = client, email 281*2139Sjp161948 282*2139Sjp161948# and for everything including object signing: 283*2139Sjp161948# nsCertType = client, email, objsign 284*2139Sjp161948 285*2139Sjp161948# This is typical in keyUsage for a client certificate. 286*2139Sjp161948# keyUsage = nonRepudiation, digitalSignature, keyEncipherment 287*2139Sjp161948 288*2139Sjp161948# This will be displayed in Netscape's comment listbox. 289*2139Sjp161948nsComment = "OpenSSL Generated Certificate" 290*2139Sjp161948 291*2139Sjp161948# PKIX recommendations harmless if included in all certificates. 292*2139Sjp161948subjectKeyIdentifier=hash 293*2139Sjp161948authorityKeyIdentifier=keyid,issuer:always 294*2139Sjp161948 295*2139Sjp161948# This stuff is for subjectAltName and issuerAltname. 296*2139Sjp161948# Import the email address. 297*2139Sjp161948# subjectAltName=email:copy 298*2139Sjp161948# An alternative to produce certificates that aren't 299*2139Sjp161948# deprecated according to PKIX. 300*2139Sjp161948# subjectAltName=email:move 301*2139Sjp161948 302*2139Sjp161948# Copy subject details 303*2139Sjp161948# issuerAltName=issuer:copy 304*2139Sjp161948 305*2139Sjp161948#nsCaRevocationUrl = http://www.domain.dom/ca-crl.pem 306*2139Sjp161948#nsBaseUrl 307*2139Sjp161948#nsRevocationUrl 308*2139Sjp161948#nsRenewalUrl 309*2139Sjp161948#nsCaPolicyUrl 310*2139Sjp161948#nsSslServerName 311*2139Sjp161948 312*2139Sjp161948# This really needs to be in place for it to be a proxy certificate. 313*2139Sjp161948proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo 314