<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Feb 6, 2020 at 5:45 PM Viktor Dukhovni <<a href="mailto:openssl-users@dukhovni.org">openssl-users@dukhovni.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Thu, Feb 06, 2020 at 02:36:03PM -0500, Michael Leone wrote:<br>
<br>
> Oh, I can add extensions by signing and using the -extfile option, and<br>
> specifying a file with the specific options I want to give the<br>
> certificate. But I don't want to have to use an addon file, I want to<br>
> add parameters to all signed certificates.<br>
<br>
The documentation of x509(1) which you're using with "-req" as a<br>
mini-CA, states explicitly:<br>
<br>
       -extfile filename<br>
           File containing certificate extensions to use. If not specified<br>
           then no extensions are added to the certificate.<br>
<br>
       -extensions section<br>
           The section to add certificate extensions from. If this option is<br>
           not specified then the extensions should either be contained in the<br>
           unnamed (default) section or the default section should contain a<br>
           variable called "extensions" which contains the section to use. See<br>
           the x509v3_config(5) manual page for details of the extension<br>
           section format.<br>
<br></blockquote><div><br></div><div>Ok. I'm not really a Linux guy, but I guess that means to do a "man 5 x509v3_config"?</div><div><br></div><div>I'll check when I get to work. I guess I just have a section mislabeled, or I need to call a section differently?</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">However, you don't need to create any static .cnf files with the desired<br>
settings.  You can specify a "-extfile" on the fly via bash(1) inline<br>
files:<br>
<br>
    openssl x509 -extfile <(printf "..." ....) ...<br>
<br>
which is the approach taken in:<br>
<br>
    <a href="https://github.com/openssl/openssl/blob/master/test/certs/mkcert.sh" rel="noreferrer" target="_blank">https://github.com/openssl/openssl/blob/master/test/certs/mkcert.sh</a></blockquote><div><br></div><div><br></div><div>As I said, not really a Linux guy. More, I need to write this as a HOWTO for the others in my department, who have little (well, no) Linux experience. I can tell them what changes to make to a text file, and how to scp it to the Linux box, and then a step-by-step how to sign a cert using said file, and then scp it back to where it needs to be (we're a Windows place, with rare exceptions).</div><div><br></div><div>I'll look into it tomorrow at work. If I have further issues, I'll be back. :-)<br></div><div><br></div><div>Thanks for the help.</div><div><br></div></div></div>