<div dir="auto">A CSR is self-signed to provide what's called "proof of possession" -- that is, proof that the requester possesses the private key to the claimed public key.  It doesn't act as a CA in that case, because the CSR is not an actual Certificate structure.<div dir="auto"><br></div><div dir="auto">-Kyle H</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jan 30, 2020, 18:26 Douglas Morris via openssl-users <<a href="mailto:openssl-users@openssl.org">openssl-users@openssl.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><div><div dir="ltr">Thanks, Dw.</div><div dir="ltr"><br></div><div dir="ltr">Interesting. I think I misunderstood this explanation about the -signkey <file> option: "<span>This option causes the input file to be self signed using the supplied private key.</span>"</div><div dir="ltr"><br></div><div dir="ltr">Your input has me thinking that a certificate signing request is in fact self-signed like a self-signed certificate is self-signed. I think I mistakenly supposed any self-signing meant acting like a "mini CA". I shall give those two x509 options, '<span>-x509toreq' and '<span>-signkey</span>',</span> a try.<br></div><div><br></div><div><div>Douglas Morris<br></div></div></div>
        <div><br></div><div><br></div>
        
        </div><div id="m_3465907939498170376yahoo_quoted_0792770129">
            <div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a">
                
                <div>
                    On Thursday, January 30, 2020, 3:51:45 PM EST, Dirk-Willem van Gulik <<a href="mailto:dirkx@webweaving.org" target="_blank" rel="noreferrer">dirkx@webweaving.org</a>> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="m_3465907939498170376yiv5474703350"><div><br clear="none"><div><br clear="none"><blockquote type="cite"><div id="m_3465907939498170376yiv5474703350yqtfd46163"><div>On 30 Jan 2020, at 21:38, Douglas Morris via openssl-users <<a rel="nofollow noreferrer" shape="rect" href="mailto:openssl-users@openssl.org" target="_blank">openssl-users@openssl.org</a>> wrote:</div><br clear="none"><div><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><div><div dir="ltr">I am trying to implement automated domain certificate renewal. A certificate signing request is sent to an ACME server and on success a certificate is returned. I'd like to be able to call OpenSSL to make a new key and then make a new certificate signing request just like the old one except for the replacement key pair file.</div><div dir="ltr"><span><br clear="none"></span></div><div dir="ltr"><span>I suppose the complete information beyond the new key data is available both in the old crs and 
the old certificate. I'm looking at the 
manpages of OpenSSL subcommands 'req' and 'x509'. The openssl x509 
option '<span>-x509toreq</span>' gave me a momentary rush of hope, but then I read about the '<span>-signkey</span>' option, which seems to be exclusively about self-signing.</span><br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Is 'cloning' the csr or cert. information semantically logical? Is it possible with OpenSSL?<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">If I can't reliably extract the relevant data from the old csr or old certification, I suppose I must do it as usual with a dedicated config file and the '-batch' option:</div><div dir="ltr">     openssl req -key <key> -<span>new -config <config.ini> -outform PEM -out <outfile></span> -batch</div></div></div></div></div></div></blockquote><div><br clear="none"></div><div>openssl x509 -x509toreq should do the trick</div><div><br clear="none"></div><div>E.g.</div><div><br clear="none"></div><div><span style="white-space:pre-wrap">           </span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(12,255,0);background-color:rgba(255,255,255,0.901961)"><span><span style="white-space:pre-wrap">       </span># generate test cert</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(12,255,0);background-color:rgba(255,255,255,0.901961)"><span><span style="white-space:pre-wrap">      </span>openssl req -x509 -new -subj /CN=foo -nodes -keyout x.key > x.crt</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(12,255,0);background-color:rgba(255,255,255,0.901961)"><span><span style="white-space:pre-wrap">      </span>openssl x509 -in x.crt -noout -text</span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(12,255,0);background-color:rgba(255,255,255,0.901961)"><span><br clear="none"></span></div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(12,255,0);background-color:rgba(255,255,255,0.901961)"><span style="white-space:pre-wrap">    </span># turn test cert in a request</div><div style="margin:0px;font-stretch:normal;line-height:normal;font-family:Menlo;color:rgb(12,255,0);background-color:rgba(255,255,255,0.901961)"><span><span style="white-space:pre-wrap">  </span>openssl x509 -x509toreq -signkey x.key < x.crt</span></div><div><br clear="none"></div><div>Dw</div><div id="m_3465907939498170376yiv5474703350yqtfd87818"><div><br clear="none"></div></div></div></div></div></div>
            </div>
        </div></div></blockquote></div>