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 8504593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:04:43+00:00 2026-06-11T02:04:43+00:00

Is it normal that SSL_accept(ssl) takes 200 ms? Running as a windows service, written

  • 0

Is it normal that SSL_accept(ssl) takes 200 ms?

Running as a windows service, written in c++, using MFC and Boost. Running on an intel xeon e5620 2.4G, with 4GB memory, and Win 7 Pro.

Following is my code. I meanwhile suspected that maybe other methods before SSL_accept (SSL_CTX_* RAND_* etc) might consume long time , but I logged everthing and discovered that SSL_accept is eating all the time.

int verify_callback(int preverify_ok, X509_STORE_CTX *ctx)
{
    return preverify_ok;
}    
void somemethod() {    
    SSL *ssl  = 0;
    SSL_CTX *tlsctx = 0;
    int ret_conn = -1;
    tlsctx = SSL_CTX_new( SSLv23_method());

    SSL_CTX_use_certificate_file(tlsctx, sCert , SSL_FILETYPE_PEM);

    SSL_CTX_use_PrivateKey_file(tlsctx, sKey , SSL_FILETYPE_PEM);

        RAND_write_file(sRandomPem);
        int _rand_loaded = RAND_load_file(sRandomPem, -1 );   

        if(! SSL_CTX_load_verify_locations(tlsctx, sCACert, NULL))
        {
            // TODO //  /* Handle error here */     
        }
        SSL_CTX_set_verify( tlsctx, SSL_VERIFY_PEER, verify_callback );

        ssl = SSL_new(tlsctx);

        int _error = SSL_ERROR_WANT_READ;

        int loopCount  = 0;


        // START MEASURING TIME FROM HERE
        SSL_set_fd(ssl, _sck);
        while(ret_conn != 1 ) 
        {
            loopCount++;

            ret_conn = SSL_accept(ssl);

            _error = SSL_get_error(ssl, ret_conn);
            switch (_error) 
            { 
            case SSL_ERROR_NONE: 
                    break; 
            case SSL_ERROR_WANT_WRITE: 
                    break; 
            case SSL_ERROR_WANT_READ: 
                    break; 
            case SSL_ERROR_WANT_X509_LOOKUP: 
                    break; 
            case SSL_ERROR_SYSCALL: 
                    break; 
            case SSL_ERROR_SSL: 
                    break; 
            case SSL_ERROR_ZERO_RETURN: 
                    break; 
            } 

            if( _error == SSL_ERROR_WANT_READ || _error == SSL_ERROR_WANT_WRITE)
            { 
                Sleep(1);
            } else
            {
                break;
            }
        }

        if( ret_conn < 1)
        {
            Log("SSL_accept -1 ", ERR_error_string(_error, NULL));
            return;
        }
        // MEASURING END HERE, takes ~200ms (on successfully accepting connection)
}

  • 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-06-11T02:04:45+00:00Added an answer on June 11, 2026 at 2:04 am

    To my knowledge, SSL_accept is a blocking function, which waits for your client to connect. If your client connect 200 ms later than the beginning for the SSL_accept call, then you will measure that waiting time.

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

Sidebar

Related Questions

I have a function that generates normal random number matrix having normal distribution using
I created a web service that I want to make more secure by using
Is that normal that this line: echo date(Y-m-d h:m:s a, strtotime('2012-03-18 12:55:00')) gives me
I have read that 'Normal' ARM instructions are fixed length - 32 bits. And
I have a UITableView that in 'normal' mode, show a UITableViewCellAccessoryDisclosureIndicator meaning if the
I have a monodroid application that uses a .net library that contains normal .resx
Hello i have a products table that contains normal products and configurable product It
I have two images. One that is normal, and another that is more colourised.
Or any other normal scripting language for that matter. I know there is VBScript
Is it normal to have tests that are way bigger than the actual code

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.