Cambiar valores por defecto del OPENSSL

Para generar certificados con openssl se utiliza el comando

# openssl req -newkey rsa:2048 -new > server.csr
Generating a 2048 bit RSA private key
............................+++
..............................+++
writing new private key to 'privkey.pem'
Enter PEM pass phrase:CLAVE
Verifying - Enter PEM pass phrase:CLAVE
-----
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) :XX
State or Province Name (full name) [Some-State]: XXXXXX
Locality Name (eg, city) []:XXXXXX
Organization Name (eg, company) [Internet Widgits Pty Ltd]: XXXXXX
Organizational Unit Name (eg, section) []:XXXXXX
Common Name (eg, YOUR name) []:example.aeiou.com.xx
Email Address []:XXXXXX@aeiou.com

Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []: NADA
An optional company name []: NADA
#

Si alguno de los campos queremos dejarlo en blanco, al dar enter sin poner ningun valor, toma el valor por defecto.. Para borrar esos valores hay que editar el siguiente archivo:

# vi /usr/share/ssl/openssl.cnf

Ahi se puede grepear el valor que se encuentra entre corchetes ( " [ ] " ) al momento de ingresar el parametro en la generacion del file, por ejemplo:


Country Name (2 letter code) []:
State or Province Name (full name) [Newbury]:
Locality Name (eg, city) []:
Organization Name (eg, company) []:
Organizational Unit Name (eg, section) []:
Common Name (eg, YOUR name) []:
Email Address []:

Si queremos dejar en blanco el campo State, debemos ir al file /usr/share/ssl/openssl.cnf y borrar el valor que se encuentra por defecto, en este caso Newbury.

0 comentarios - Cambiar valores por defecto del OPENSSL