<div dir="ltr"><div><div><div>Damn the semicolon at the end :(<br></div>Sorry for the noise.<br><br><br></div>Thanks and Regards,<br></div>Ajay<br><div><div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Oct 10, 2016 at 11:23 AM, Ajay Garg <span dir="ltr"><<a href="mailto:ajaygargnsit@gmail.com" target="_blank">ajaygargnsit@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>[Thanks Viktor, I made the change as suggested by you in the other incomplete email that I sent accidentally].<br></div><div><br><br>Hi All.<br><br>We are just dealing with the client-side, and following are the steps ::<br><br>##############################<wbr>##############################<wbr>##############################<wbr>#######<br>    SSL_library_init();<br>    OpenSSL_add_ssl_algorithms();<br>    OpenSSL_add_all_algorithms();<br>    SSL_load_error_strings();<br>    ERR_load_crypto_strings();<br><br>    solitary_ssl_ctx = SSL_CTX_new(SSLv23_client_<wbr>method());<br>    if(solitary_ssl_ctx == NULL)<br>    {<br>        // Control does not reach here.<br>    }<br><br>    if(!SSL_CTX_use_certificate_<wbr>file(solitary_ssl_ctx, "/path/of/certificate", SSL_FILETYPE_PEM))<br>    {<br>        // Control does not reach here.<br>    }<br><br>    if(!SSL_CTX_use_PrivateKey_<wbr>file(solitary_ssl_ctx, "/path/of/key", SSL_FILETYPE_PEM))<br>    {<br>        // Control does not reach here.<br>    }<br><br>    socket->ssl = SSL_new(solitary_ssl_ctx);<br>    if(socket->ssl == NULL)<br>    {<br></div>        // Control does not reach here.<div><div>    }<br><br>    if (!BIO_new_bio_pair(&(socket-><wbr>inter_bio), SSL_BUFFER_SIZE, &(socket->network_bio), SSL_BUFFER_SIZE));<br>    {<br></div><div>        // <b>CONTROL REACHES HERE</b><br></div><div>    }<br><br>    socket->ssl_bio = BIO_new(BIO_f_ssl());<br>    if (!(socket->ssl_bio))<br>    {<br>        // Status Unknown<br>    }<br><br>    SSL_set_connect_state(socket-><wbr>ssl);<br>    SSL_set_bio(socket->ssl, socket->inter_bio, socket->inter_bio);<br>    (void)BIO_set_ssl(socket->ssl_<wbr>bio, socket->ssl, BIO_NOCLOSE);<br>##############################<wbr>##############################<wbr>##############################<wbr>#######<br><br><br><br><br></div><div>The socket structure has the following ::<br><br>##############################<wbr>##############################<wbr>##############################<wbr>#######<br></div><div>           SSL *ssl;<br><br></div><div>           BIO *ssl_bio;                 // app-payload-bytes will be written by app into it.<br></div><div>           BIO *inter_bio;               // intermediate-bio, have no idea what it really is used for.<br></div><div>           BIO *network_bio;          // app-payload-encrypted-bytes will "emerge" from this bio, ready to be written over the wire<br></div><div>##############################<wbr>##############################<wbr>##############################<wbr>#######<br><br><br></div><div><br></div><div>I have followed the minimal steps (only for client-mode) as per <a href="http://opensource.apple.com/source/OpenSSL096/OpenSSL096-6.2/openssl/ssl/ssltest.c" target="_blank">http://opensource.apple.com/<wbr>source/OpenSSL096/OpenSSL096-<wbr>6.2/openssl/ssl/ssltest.c</a><br></div><div>So, what am I missing which is causing<br><br></div><div>                   BIO_new_bio_pair<br><br></div><div>to fail?<br><br><br></div><div>Thanks and Regards,<br></div><div>Ajay<br></div><div><br></div></div></div>
</blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Regards,<br>Ajay<br></div>
</div></div></div></div></div></div>