OpenSSL and error in reading openssl.conf file OpenSSL and error in reading openssl.conf file windows windows

OpenSSL and error in reading openssl.conf file


On Windows you can also set the environment property OPENSSL_CONF. For example from the commandline you can type:

set OPENSSL_CONF=c:/libs/openssl-0.9.8k/openssl.cnf

to validate it you can type:

echo %OPENSSL_CONF%

You can also set it as part of the computer's environmental variables so all users and services have it available by default. See, for example, Environment variables in Windows NT and How To Manage Environment Variables in Windows XP.

Now you can run openssl commands without having to pass the config location parameter.


Just add to your command line the parameter -config c:\your_openssl_path\openssl.cfg, changing your_openssl_path to the real installed path.


Just create an openssl.cnf file yourself like this in step 4: http://www.flatmtn.com/article/setting-openssl-create-certificates

Edit after link stopped workingThe content of the openssl.cnf file was the following:

## OpenSSL configuration file.## Establish working directory.dir                 = .[ ca ]default_ca              = CA_default[ CA_default ]serial                  = $dir/serialdatabase                = $dir/certindex.txtnew_certs_dir               = $dir/certscertificate             = $dir/cacert.pemprivate_key             = $dir/private/cakey.pemdefault_days                = 365default_md              = md5preserve                = noemail_in_dn             = nonameopt                 = default_cacertopt                 = default_capolicy                  = policy_match[ policy_match ]countryName             = matchstateOrProvinceName         = matchorganizationName            = matchorganizationalUnitName          = optionalcommonName              = suppliedemailAddress                = optional[ req ]default_bits                = 1024          # Size of keysdefault_keyfile             = key.pem       # name of generated keysdefault_md              = md5               # message digest algorithmstring_mask             = nombstr       # permitted charactersdistinguished_name          = req_distinguished_namereq_extensions              = v3_req[ req_distinguished_name ]# Variable name             Prompt string#-------------------------    ----------------------------------0.organizationName          = Organization Name (company)organizationalUnitName          = Organizational Unit Name (department, division)emailAddress                = Email AddressemailAddress_max            = 40localityName                = Locality Name (city, district)stateOrProvinceName         = State or Province Name (full name)countryName             = Country Name (2 letter code)countryName_min             = 2countryName_max             = 2commonName              = Common Name (hostname, IP, or your name)commonName_max              = 64# Default values for the above, for consistency and less typing.# Variable name             Value#------------------------     ------------------------------0.organizationName_default      = My CompanylocalityName_default            = My TownstateOrProvinceName_default     = State or ProvidencecountryName_default         = US[ v3_ca ]basicConstraints            = CA:TRUEsubjectKeyIdentifier            = hashauthorityKeyIdentifier          = keyid:always,issuer:always[ v3_req ]basicConstraints            = CA:FALSEsubjectKeyIdentifier            = hash