<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">Hi All,</span></div>
<div style=""><span style="color: rgb(0, 0, 0); font-family: Consolas, Courier, monospace; font-size: 10pt;">I am facinmg issue while u</span><span style="color: rgb(0, 0, 0); font-family: Consolas, Courier, monospace; font-size: 13.3333px;">pgrading</span><span style="color: rgb(0, 0, 0); font-family: Consolas, Courier, monospace; font-size: 10pt;"> my
 OpenSSL version from 1.0.2p to 1.1.1c. </span><br>
</div>
<div style=""><font color="#000000" face="Consolas, Courier, monospace"><span style="font-size: 10pt;">I am facing the issue where "</span><span style="background-color: rgb(255, 255, 255); display: inline !important;"><span style="font-size: 10pt;">ENGINE_by_id("capi")"
 is not </span><span style="font-size: 13.3333px;">returning</span><span style="font-size: 10pt;"> proper pointer. I want to access windows certificate store with certificate and keys. </span></span></font></div>
<div style=""><font color="#000000" face="Consolas, Courier, monospace"><span style="background-color: rgb(255, 255, 255); display: inline !important;"><span style="font-size: 10pt;"><br>
</span></span></font></div>
<div style=""><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">Snippet of my working code in 1.0.2p:(This is working fine)</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"><span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important">This is working fine and I am able to get the Private key.</span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"><span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important">-------------------</span><span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important">-------------------</span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">      ENGINE_load_capi()</span><span><br>
</span>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">      ce = ENGINE_by_id("capi");</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">      if (NULL == ce)</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">      {</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">         ENGINE_cleanup();
</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">         return E_LOAD_FAILED;</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">      }</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">      if (!ENGINE_init(ce)||!ENGINE_register_STORE(ce) )
</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">      {</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">         ENGINE_cleanup();
</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">         ce = NULL;</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">         return E_INIT_FAILED;</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">      }  
</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">     (void)ENGINE_ctrl_cmd(ce,"store_flags",0, NULL, NULL, 0);</span><br>
</div>
<div><span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">     (void)ENGINE_ctrl_cmd(ce,"store_name" ,0, (void*)storeName, NULL, 0);
</span><br>
</div>
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">     privateKey  = ENGINE_load_private_key(ce,"certname", 0, 0);</span><br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">
<div style="margin: 0px; font-size: 16px; font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; color: rgb(50, 49, 48); background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace; color: rgb(0, 0, 0)">I can see that<span style="margin: 0px"> </span></span><span style="margin: 0px; font-size: 13.3333px; font-family: Consolas, Courier, monospace; color: rgb(0, 0, 0)">few
 CAPI API </span><span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace; color: rgb(0, 0, 0)">is<span style="margin: 0px"> </span></span><span style="margin: 0px; font-size: 13.3333px; font-family: Consolas, Courier, monospace; color: rgb(0, 0, 0)">deprecated</span><font color="#000000" face="Consolas, Courier, monospace"><span style="margin: 0px; font-size: 10pt"> in
 1.1.1c, but they can be enabled by<span style="margin: 0px"> </span></span><span style="margin: 0px; font-size: 13.3333px">following</span><span style="margin: 0px; font-size: 10pt"> configuration(Based on engine.h)</span></font><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; color: rgb(50, 49, 48); background-color: rgb(255, 255, 255)">
<font color="#000000" face="Consolas, Courier, monospace"><span style="margin: 0px; font-size: 10pt">> "perl Configure debug-VC-WIN64A no-asm enable-capieng no-shared no-dynamic-engine --api=1.0.0"<br>
</span></font></div>
<div style="margin: 0px; font-size: 12pt; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">Code from 1.1.1c:</span></div>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"><span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important">-------------------</span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;">
<div style="margin: 0px; font-size: 16px; font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", sans-serif; color: rgb(50, 49, 48)">
<br>
</div>
<br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"> </span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"><span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255)">      ENGINE_load_capi()</span><span style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)"><br>
</span>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">      ce = ENGINE_by_id("capi");   <<================Returning NULL always</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">      if (NULL == ce)</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">      {</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">         ENGINE_cleanup();<span> </span></span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">         return E_LOAD_FAILED;</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">      }</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">      if (!ENGINE_init(ce)||!ENGINE_register_complete(ce) )<span> </span></span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">      {</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">         ENGINE_cleanup();<span> </span></span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">         ce = NULL;</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">         return E_INIT_FAILED;</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">      }  <span> </span></span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">     (void)ENGINE_ctrl_cmd(ce,"store_flags",0, NULL, NULL, 0);</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">     (void)ENGINE_ctrl_cmd(ce,"store_name" ,0, (void*)storeName, NULL, 0);<span> </span></span><br>
</div>
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255)">     privateKey  = ENGINE_load_private_key(ce,"certname", 0, 0);</span><br>
</span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"><span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255)"><br>
</span></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"><span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255)"><br>
</span></span></div>
<div style=""><span style="margin: 0px; background-color: rgb(255, 255, 255);"><font color="#000000" face="Consolas, Courier, monospace"><span style="font-size: 10pt;">If I change my code to the
</span><span style="font-size: 13.3333px;">following</span><span style="font-size: 10pt;"> way, I get one pointer but when I try to load the private key I get always empty private key. </span></font></span></div>
<div style=""><span style="margin: 0px; background-color: rgb(255, 255, 255);"><font color="#000000" face="Consolas, Courier, monospace"><span style="font-size: 10pt;"><span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important">>
 "perl Configure debug-VC-WIN64A no-asm<span> </span></span><br>
</span></font></span></div>
<div style=""><span style="margin: 0px; background-color: rgb(255, 255, 255);"><font color="#000000" face="Consolas, Courier, monospace"><span style="font-size: 10pt;"><span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important"><span><br>
</span></span></span></font></span></div>
<div style=""><span style="margin: 0px; background-color: rgb(255, 255, 255);"><font color="#000000" face="Consolas, Courier, monospace"><span style="font-size: 10pt;"><span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important"><span>Code:</span></span></span></font></span></div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<span style="font-family: Consolas, Courier, monospace; font-size: 10pt;"><span>  int rc = 0;<br>
</span>
<div>  ENGINE_load_builtin_engines();</div>
<div>  ce= ENGINE_by_id("dynamic"); <span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important"><<==============Engine Pointer with no valid data</span></div>
<div>  rc = ENGINE_ctrl_cmd_string(ce, "SO_PATH", "c://mylib//capi.dll", 0); if (! rc) return ERROR_RC;</div>
<div>  rc=  ENGINE_ctrl_cmd_string(ce, "LOAD", NULL, 0);<span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important"> if (! rc) return ERROR_RC;</span><br>
</div>
<div>  rc = ENGINE_register_complete(ce)<span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important">; if (! rc) return ERROR_RC;</span><br>
</div>
<div>  rc = ERR_load_ENGINE_strings()<span style="font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255); display: inline !important">; if (! rc) return ERROR_RC;</span><br>
</div>
<div>  <br>
</div>
<div>      if (NULL == ce)<br>
</div>
<div>      {<br>
</div>
<div>         ENGINE_cleanup(); <br>
</div>
<div>         return LOAD_E_FAILED;<br>
</div>
<div>      }<br>
</div>
<div>        if (!ENGINE_init(ce))</div>
<div>      {<br>
</div>
<div>         ENGINE_cleanup(); <br>
</div>
<div>         sCapiEngine = NULL;<br>
</div>
<div>         return INIT_E_FAILED;<br>
</div>
<div>      }<br>
</div>
<div>  ENGINE_register_complete(ce); </div>
<div></div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">  (void)ENGINE_ctrl_cmd(ce,"store_flags",0, NULL, NULL, 0);</span><br>
</div>
<div style="margin: 0px; font-size: 16px; font-family: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255)">
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace">  (void)ENGINE_ctrl_cmd(ce,"store_name" ,0, (void*)storeName, NULL, 0);<span> </span></span><br>
</div>
<span style="margin: 0px; font-size: 10pt; font-family: Consolas, Courier, monospace; background-color: rgb(255, 255, 255)">  privateKey  = ENGINE_load_private_key(ce,"certname", 0, 0); <<============Always getting NULL Private key.</span>
<div><br>
</div>
<div><br>
</div>
<div>I am not able to figure out where things are going wrong. </div>
<div><br>
</div>
<div>Is there any way I can get the desired result from Capi for windows cert store? Please help.</div>
<div><br>
</div>
<div>Thanks & regards,</div>
<div>Manoj Upadhyay</div>
<span></span><br>
</span></div>
</body>
</html>