Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7498597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T19:31:36+00:00 2026-05-29T19:31:36+00:00

I am trying to use OpenSSL in my application, and achieve a secure connection.

  • 0

I am trying to use OpenSSL in my application, and achieve a secure connection.

At first I tried:

  1. create ssl struct
  2. create socketbio for the tcp socket
  3. create a sslbio
  4. set socketbio to SSL strcut
  5. SSL_accept(ssl)
  6. BIO_push(ssl, socketbio)

This cause handshake to happen successfully, but application data wasn’t properly decrypted.

Then I tweaked a little, and relaced 6 with

(new) BIO_ctrl(sslbio, SET_SSL, ssl)

and things worked fine.

I Wanted to know, what’s wrong with previous approach, and what’s causing the new apprach work?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T19:31:39+00:00Added an answer on May 29, 2026 at 7:31 pm

    It’s hard to answer the question without knowing why you think BIO_push is all you need to do. At any rate, you shouldn’t call BIO_ctrl directly. You should use the high-level wrapper BIO_set_ssl defined in bio.h:

    #define BIO_set_ssl(b,ssl,c)    BIO_ctrl(b,BIO_C_SET_SSL,c,(char *)ssl)
    

    This macro sets the ssl member of the BIO object as you can see in bio_ssl.c:

        case BIO_C_SET_SSL:
                if (ssl != NULL)
                        ssl_free(b);
                b->shutdown=(int)num;
                ssl=(SSL *)ptr;
                ((BIO_SSL *)b->ptr)->ssl=ssl;
                bio=SSL_get_rbio(ssl);
                if (bio != NULL)
                        {
                        if (b->next_bio != NULL)
                                BIO_push(bio,b->next_bio);
                        b->next_bio=bio;
                        CRYPTO_add(&bio->references,1,CRYPTO_LOCK_BIO);
                        }
                b->init=1;
                break;
    

    The important step in this function is not the BIO_push, but rather is where it sets the ssl pointer in the BIO_SSL object to your active SSL context, i.e., ((BIO_SSL *)b->ptr)->ssl=ssl;.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to use OpenSSL in my metro application. I created a C++
I've been trying to use openssl to establish a connection with smtp.gmail.com port 587
I'm trying to create a self-signed wildcard SSL certificate for use on a number
I'm trying to write a function, that would use native openssl to do some
This is my first time trying to use the XMLRPC::Client library to interact with
I'm trying to use openssl dsa implementation, but I'm very confused with the following
I am trying to use openssl to get a certificate, and it seems to
i am trying to embed the openssl library in my Android application using Android
I have a working application that establishes an SSL connection to a server. The
I'm trying to use the SSL_CTX_use_PrivateKey_file function in OpenSSL under Linux, but it returns

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.