[openssl-users] Sequence of steps to initialize a ssl-session (only client-mode)

Ajay Garg ajaygargnsit at gmail.com
Mon Oct 10 05:25:10 UTC 2016


Hi All.

We are just dealing with the client-side, and following are the steps ::

    SSL_library_init();
    OpenSSL_add_ssl_algorithms();
    OpenSSL_add_all_algorithms();
    SSL_load_error_strings();
    ERR_load_crypto_strings();

    solitary_ssl_ctx = SSL_CTX_new(TLSv1_2_client_method());
    if(solitary_ssl_ctx == NULL)
    {

        HANDLE_CATASTROPHIC_INIT_ERROR("SSL-Context")
        resetDevice();
    }

    if(!SSL_CTX_use_certificate_file(solitary_ssl_ctx,
"/home/sensegrow/cert", SSL_FILETYPE_PEM))
    {
        HANDLE_CATASTROPHIC_INIT_ERROR("SSL-Context-Certificate")
        resetDevice();
    }

    if(!SSL_CTX_use_PrivateKey_file(solitary_ssl_ctx,
"/home/sensegrow/key", SSL_FILETYPE_PEM))
    {
        HANDLE_CATASTROPHIC_INIT_ERROR("SSL-Context-Key")
        resetDevice();
    }

    ssl_init_successful = 1;



-- 
Regards,
Ajay


More information about the openssl-users mailing list