<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <tt>I thought this had become documented recently (i.e., in master
      only, not even in 1.1.0), but can't find any evidence of such
      documentation.<br>
      <br>
      SSL_CTX_use_PrivateKey() takes a reference on its pkey argument in
      the same way as SSL_CTX_use_certificate(); it is safe for the
      local code to free its local copy.<br>
      <br>
      -Ben<br>
    </tt><br>
    <div class="moz-cite-prefix">On 10/17/2017 12:32 PM, Adi
      Mallikarjuna Reddy V wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:CABexLuZGJR=1kyuZ2TyObFtXzC-JBO+S9Lh+QDrRy7i-Di22uw@mail.gmail.com">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">Is this documented some where? 
        <div><br>
        </div>
        <div>Also is the same true - with SSL_CTX_use_PrivateKey(ctx,
          evp_pkey) ? where I can free evp_pkey with EVP_PKEY_free()?</div>
        <div><br>
        </div>
        <div><br>
        </div>
        <div>Thanks</div>
        <div>Adi</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Tue, Oct 17, 2017 at 9:50 AM,
          Benjamin Kaduk <span dir="ltr"><<a
              href="mailto:bkaduk@akamai.com" target="_blank"
              moz-do-not-send="true">bkaduk@akamai.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div text="#000000" bgcolor="#FFFFFF"><span class=""> On
                10/17/2017 11:27 AM, Adi Mallikarjuna Reddy V wrote:<br>
                <blockquote type="cite">
                  <div>
                    <blockquote type="cite"
                      style="color:rgb(49,49,49);word-spacing:1px">
                      <div style="font-size:12.8px" dir="auto">
                        <div style="font-size:0.800000011920929rem"
                          dir="auto">I am only worried about the
                          following line. </div>
                        <div style="font-size:0.800000011920929rem"
                          dir="auto"><br>
                        </div>
                        <div style="font-size:0.800000011920929rem">SSL_CTX_use_certificate(ctx,
                          cert)</div>
                        <div style="font-size:0.800000011920929rem"
                          dir="auto"><br>
                        </div>
                        <div style="font-size:0.800000011920929rem"
                          dir="auto">After this line is it safe to free
                          cert object while ctx is still used later on?</div>
                        <br>
                      </div>
                    </blockquote>
                  </div>
                </blockquote>
                <br>
              </span> SSL_CTX_use_certificate(ctx, cert), on successful
              return, takes an additional reference on the supplied
              |cert| argument to account for the pointer in |ctx|. 
              Thus, the caller of SSL_CTX_use_certificate() can safely
              call X509_free(cert) to release the caller's local
              reference, while the |ctx| retains a pointer to |cert|.<br>
              <br>
              -Ben<br>
            </div>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>