Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 395 lines 12 kB view raw
1# Taken from OpenSSL 3.0.7 and modified according to: https://wiki.openssl.org/index.php/OpenSSL_3.0#Programming_in_OpenSSL_3.0 2# 3# OpenSSL example configuration file. 4# See doc/man5/config.pod for more info. 5# 6# This is mostly being used for generation of certificate requests, 7# but may be used for auto loading of providers 8 9# Note that you can include other files from the main configuration 10# file using the .include directive. 11#.include filename 12 13# This definition stops the following lines choking if HOME isn't 14# defined. 15HOME = . 16 17 # Use this in order to automatically load providers. 18openssl_conf = openssl_init 19 20# Comment out the next line to ignore configuration errors 21config_diagnostics = 1 22 23# Extra OBJECT IDENTIFIER info: 24# oid_file = $ENV::HOME/.oid 25oid_section = new_oids 26 27# To use this configuration file with the "-extfile" option of the 28# "openssl x509" utility, name here the section containing the 29# X.509v3 extensions to use: 30# extensions = 31# (Alternatively, use a configuration file that has only 32# X.509v3 extensions in its main [= default] section.) 33 34[ new_oids ] 35# We can add new OIDs in here for use by 'ca', 'req' and 'ts'. 36# Add a simple OID like this: 37# testoid1=1.2.3.4 38# Or use config file substitution like this: 39# testoid2=${testoid1}.5.6 40 41# Policies used by the TSA examples. 42tsa_policy1 = 1.2.3.4.1 43tsa_policy2 = 1.2.3.4.5.6 44tsa_policy3 = 1.2.3.4.5.7 45 46# For FIPS 47# Optionally include a file that is generated by the OpenSSL fipsinstall 48# application. This file contains configuration data required by the OpenSSL 49# fips provider. It contains a named section e.g. [fips_sect] which is 50# referenced from the [provider_sect] below. 51# Refer to the OpenSSL security policy for more information. 52# .include fipsmodule.cnf 53 54[openssl_init] 55providers = provider_sect 56 57# List of providers to load 58[provider_sect] 59default = default_sect 60legacy = legacy_sect 61 62# The fips section name should match the section name inside the 63# included fipsmodule.cnf. 64# fips = fips_sect 65 66# If no providers are activated explicitly, the default one is activated implicitly. 67# See man 7 OSSL_PROVIDER-default for more details. 68# 69# If you add a section explicitly activating any other provider(s), you most 70# probably need to explicitly activate the default provider, otherwise it 71# becomes unavailable in openssl. As a consequence applications depending on 72# OpenSSL may not work correctly which could lead to significant system 73# problems including inability to remotely access the system. 74[default_sect] 75activate = 1 76 77[legacy_sect] 78activate = 1 79 80#################################################################### 81[ ca ] 82default_ca = CA_default # The default ca section 83 84#################################################################### 85[ CA_default ] 86 87dir = ./demoCA # Where everything is kept 88certs = $dir/certs # Where the issued certs are kept 89crl_dir = $dir/crl # Where the issued crl are kept 90database = $dir/index.txt # database index file. 91#unique_subject = no # Set to 'no' to allow creation of 92 # several certs with same subject. 93new_certs_dir = $dir/newcerts # default place for new certs. 94 95certificate = $dir/cacert.pem # The CA certificate 96serial = $dir/serial # The current serial number 97crlnumber = $dir/crlnumber # the current crl number 98 # must be commented out to leave a V1 CRL 99crl = $dir/crl.pem # The current CRL 100private_key = $dir/private/cakey.pem# The private key 101 102x509_extensions = usr_cert # The extensions to add to the cert 103 104# Comment out the following two lines for the "traditional" 105# (and highly broken) format. 106name_opt = ca_default # Subject Name options 107cert_opt = ca_default # Certificate field options 108 109# Extension copying option: use with caution. 110# copy_extensions = copy 111 112# Extensions to add to a CRL. Note: Netscape communicator chokes on V2 CRLs 113# so this is commented out by default to leave a V1 CRL. 114# crlnumber must also be commented out to leave a V1 CRL. 115# crl_extensions = crl_ext 116 117default_days = 365 # how long to certify for 118default_crl_days= 30 # how long before next CRL 119default_md = default # use public key default MD 120preserve = no # keep passed DN ordering 121 122# A few difference way of specifying how similar the request should look 123# For type CA, the listed attributes must be the same, and the optional 124# and supplied fields are just that :-) 125policy = policy_match 126 127# For the CA policy 128[ policy_match ] 129countryName = match 130stateOrProvinceName = match 131organizationName = match 132organizationalUnitName = optional 133commonName = supplied 134emailAddress = optional 135 136# For the 'anything' policy 137# At this point in time, you must list all acceptable 'object' 138# types. 139[ policy_anything ] 140countryName = optional 141stateOrProvinceName = optional 142localityName = optional 143organizationName = optional 144organizationalUnitName = optional 145commonName = supplied 146emailAddress = optional 147 148#################################################################### 149[ req ] 150default_bits = 2048 151default_keyfile = privkey.pem 152distinguished_name = req_distinguished_name 153attributes = req_attributes 154x509_extensions = v3_ca # The extensions to add to the self signed cert 155 156# Passwords for private keys if not present they will be prompted for 157# input_password = secret 158# output_password = secret 159 160# This sets a mask for permitted string types. There are several options. 161# default: PrintableString, T61String, BMPString. 162# pkix : PrintableString, BMPString (PKIX recommendation before 2004) 163# utf8only: only UTF8Strings (PKIX recommendation after 2004). 164# nombstr : PrintableString, T61String (no BMPStrings or UTF8Strings). 165# MASK:XXXX a literal mask value. 166# WARNING: ancient versions of Netscape crash on BMPStrings or UTF8Strings. 167string_mask = utf8only 168 169# req_extensions = v3_req # The extensions to add to a certificate request 170 171[ req_distinguished_name ] 172countryName = Country Name (2 letter code) 173countryName_default = AU 174countryName_min = 2 175countryName_max = 2 176 177stateOrProvinceName = State or Province Name (full name) 178stateOrProvinceName_default = Some-State 179 180localityName = Locality Name (eg, city) 181 1820.organizationName = Organization Name (eg, company) 1830.organizationName_default = Internet Widgits Pty Ltd 184 185# we can do this but it is not needed normally :-) 186#1.organizationName = Second Organization Name (eg, company) 187#1.organizationName_default = World Wide Web Pty Ltd 188 189organizationalUnitName = Organizational Unit Name (eg, section) 190#organizationalUnitName_default = 191 192commonName = Common Name (e.g. server FQDN or YOUR name) 193commonName_max = 64 194 195emailAddress = Email Address 196emailAddress_max = 64 197 198# SET-ex3 = SET extension number 3 199 200[ req_attributes ] 201challengePassword = A challenge password 202challengePassword_min = 4 203challengePassword_max = 20 204 205unstructuredName = An optional company name 206 207[ usr_cert ] 208 209# These extensions are added when 'ca' signs a request. 210 211# This goes against PKIX guidelines but some CAs do it and some software 212# requires this to avoid interpreting an end user certificate as a CA. 213 214basicConstraints=CA:FALSE 215 216# This is typical in keyUsage for a client certificate. 217# keyUsage = nonRepudiation, digitalSignature, keyEncipherment 218 219# PKIX recommendations harmless if included in all certificates. 220subjectKeyIdentifier=hash 221authorityKeyIdentifier=keyid,issuer 222 223# This stuff is for subjectAltName and issuerAltname. 224# Import the email address. 225# subjectAltName=email:copy 226# An alternative to produce certificates that aren't 227# deprecated according to PKIX. 228# subjectAltName=email:move 229 230# Copy subject details 231# issuerAltName=issuer:copy 232 233# This is required for TSA certificates. 234# extendedKeyUsage = critical,timeStamping 235 236[ v3_req ] 237 238# Extensions to add to a certificate request 239 240basicConstraints = CA:FALSE 241keyUsage = nonRepudiation, digitalSignature, keyEncipherment 242 243[ v3_ca ] 244 245 246# Extensions for a typical CA 247 248 249# PKIX recommendation. 250 251subjectKeyIdentifier=hash 252 253authorityKeyIdentifier=keyid:always,issuer 254 255basicConstraints = critical,CA:true 256 257# Key usage: this is typical for a CA certificate. However since it will 258# prevent it being used as an test self-signed certificate it is best 259# left out by default. 260# keyUsage = cRLSign, keyCertSign 261 262# Include email address in subject alt name: another PKIX recommendation 263# subjectAltName=email:copy 264# Copy issuer details 265# issuerAltName=issuer:copy 266 267# DER hex encoding of an extension: beware experts only! 268# obj=DER:02:03 269# Where 'obj' is a standard or added object 270# You can even override a supported extension: 271# basicConstraints= critical, DER:30:03:01:01:FF 272 273[ crl_ext ] 274 275# CRL extensions. 276# Only issuerAltName and authorityKeyIdentifier make any sense in a CRL. 277 278# issuerAltName=issuer:copy 279authorityKeyIdentifier=keyid:always 280 281[ proxy_cert_ext ] 282# These extensions should be added when creating a proxy certificate 283 284# This goes against PKIX guidelines but some CAs do it and some software 285# requires this to avoid interpreting an end user certificate as a CA. 286 287basicConstraints=CA:FALSE 288 289# This is typical in keyUsage for a client certificate. 290# keyUsage = nonRepudiation, digitalSignature, keyEncipherment 291 292# PKIX recommendations harmless if included in all certificates. 293subjectKeyIdentifier=hash 294authorityKeyIdentifier=keyid,issuer 295 296# This stuff is for subjectAltName and issuerAltname. 297# Import the email address. 298# subjectAltName=email:copy 299# An alternative to produce certificates that aren't 300# deprecated according to PKIX. 301# subjectAltName=email:move 302 303# Copy subject details 304# issuerAltName=issuer:copy 305 306# This really needs to be in place for it to be a proxy certificate. 307proxyCertInfo=critical,language:id-ppl-anyLanguage,pathlen:3,policy:foo 308 309#################################################################### 310[ tsa ] 311 312default_tsa = tsa_config1 # the default TSA section 313 314[ tsa_config1 ] 315 316# These are used by the TSA reply generation only. 317dir = ./demoCA # TSA root directory 318serial = $dir/tsaserial # The current serial number (mandatory) 319crypto_device = builtin # OpenSSL engine to use for signing 320signer_cert = $dir/tsacert.pem # The TSA signing certificate 321 # (optional) 322certs = $dir/cacert.pem # Certificate chain to include in reply 323 # (optional) 324signer_key = $dir/private/tsakey.pem # The TSA private key (optional) 325signer_digest = sha256 # Signing digest to use. (Optional) 326default_policy = tsa_policy1 # Policy if request did not specify it 327 # (optional) 328other_policies = tsa_policy2, tsa_policy3 # acceptable policies (optional) 329digests = sha1, sha256, sha384, sha512 # Acceptable message digests (mandatory) 330accuracy = secs:1, millisecs:500, microsecs:100 # (optional) 331clock_precision_digits = 0 # number of digits after dot. (optional) 332ordering = yes # Is ordering defined for timestamps? 333 # (optional, default: no) 334tsa_name = yes # Must the TSA name be included in the reply? 335 # (optional, default: no) 336ess_cert_id_chain = no # Must the ESS cert id chain be included? 337 # (optional, default: no) 338ess_cert_id_alg = sha1 # algorithm to compute certificate 339 # identifier (optional, default: sha1) 340 341[insta] # CMP using Insta Demo CA 342# Message transfer 343server = pki.certificate.fi:8700 344# proxy = # set this as far as needed, e.g., http://192.168.1.1:8080 345# tls_use = 0 346path = pkix/ 347 348# Server authentication 349recipient = "/C=FI/O=Insta Demo/CN=Insta Demo CA" # or set srvcert or issuer 350ignore_keyusage = 1 # potentially needed quirk 351unprotected_errors = 1 # potentially needed quirk 352extracertsout = insta.extracerts.pem 353 354# Client authentication 355ref = 3078 # user identification 356secret = pass:insta # can be used for both client and server side 357 358# Generic message options 359cmd = ir # default operation, can be overridden on cmd line with, e.g., kur 360 361# Certificate enrollment 362subject = "/CN=openssl-cmp-test" 363newkey = insta.priv.pem 364out_trusted = insta.ca.crt 365certout = insta.cert.pem 366 367[pbm] # Password-based protection for Insta CA 368# Server and client authentication 369ref = $insta::ref # 3078 370secret = $insta::secret # pass:insta 371 372[signature] # Signature-based protection for Insta CA 373# Server authentication 374trusted = insta.ca.crt # does not include keyUsage digitalSignature 375 376# Client authentication 377secret = # disable PBM 378key = $insta::newkey # insta.priv.pem 379cert = $insta::certout # insta.cert.pem 380 381[ir] 382cmd = ir 383 384[cr] 385cmd = cr 386 387[kur] 388# Certificate update 389cmd = kur 390oldcert = $insta::certout # insta.cert.pem 391 392[rr] 393# Certificate revocation 394cmd = rr 395oldcert = $insta::certout # insta.cert.pem