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

  • SEARCH
  • Home
  • 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 9276157
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:46:20+00:00 2026-06-18T16:46:20+00:00

So I have a certificate chain stored in STACK_OF(X509). This is what I did

  • 0

So I have a certificate chain stored in STACK_OF(X509).
This is what I did with it :

STACK_OF(X509) *chain = SSL_get_peer_cert_chain(ssl);

X509_STORE_CTX* newCert = X509_STORE_CTX_new();
if(newCert){
    X509_STORE_CTX_set_chain(newCert, chain);
    std::cout << X509_verify_cert(newCert) << std::endl;
}
std::cout << "ERROR : " << X509_STORE_CTX_get_error(newCert) << std::endl;

The issue is that the X509_verify_cert(newCert) returns -1 meaning the initialization of the X509_STORE_CTX was not down properly. What am I missing?

  • 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-18T16:46:21+00:00Added an answer on June 18, 2026 at 4:46 pm

    I guess, this is related to Use of STACK_OF(X509).

    You shouldn’t copy only half of the source code at apps/verify.c. If you look deeper, you will find, among other lines,

     286         if(!X509_STORE_CTX_init(csc,ctx,x,uchain))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a certificate chain in STACK_OF(X509) that I would like to verify. But
I have a certificate in der format, from it with this command I generate
I have created a certificate using the following SSL command: makecert -r -pe -n
I have the error The X.509 certificate ... chain building failed. The certificate that
I have this certificate on my server: DigiCert -> DigiCert High Assurance EV CA-3
I have a wilcard certificate along with a certificate chain and private key. How
This is an extension question to: how-do-i-create-a-self-signed-certificate-for-code-signing-on-windows To take this further, if I have
I have a requirement to ensure that the x509 certificate that the client presents
For an application, I need to have a SSL certificate for a WCF service,
Am I able to extract certificate chain information from a CA-signed X509 client certificate

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.