is it possible making openssl skipping the country/common name prompts?

后端 未结 5 1722
长情又很酷
长情又很酷 2021-01-31 13:05

Is there a way to make openssl skiping the prompts such as

Country Name (2 letter code) [US]:
Organization Name (eg, company) [My Company Name LTD.]:
Common Nam         


        
5条回答
  •  佛祖请我去吃肉
    2021-01-31 13:55

    Another solution consists of using the prompt = no directive in your config file.
    See OpenSsl: Configuration file format

    prompt

    if set to the value no this disables prompting of certificate fields and just takes values from the config file directly. It also changes the expected format of the distinguished_name and attributes sections.

    There are two separate formats for the distinguished name and attribute sections.

    If the prompt option is set to no then these sections just consist of field names and values: for example,

     CN = My Name
     OU = My Organization
     emailAddress = someone@somewhere.org
    

    This allows external programs (e.g. GUI based) to generate a template file with all the field names and values and just pass it to req.

    Alternatively if the prompt option is absent or not set to no then the file contains field prompting information. It consists of lines of the form:

     fieldName="prompt"
     fieldName_default="default field value"
     fieldName_min= 2
     fieldName_max= 4
    

提交回复
热议问题