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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:42:23+00:00 2026-06-09T14:42:23+00:00

How do I catch the domain name mismatch? I use SSL_get_peer_certificate(ssl) to get the

  • 0

How do I catch the domain name mismatch?

I use SSL_get_peer_certificate(ssl) to get the certificate, then SSL_get_verify_result(ssl); to verify the certificate. How can i catch the domain name mismatch here as I am not catching it currently.

  • 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-09T14:42:25+00:00Added an answer on June 9, 2026 at 2:42 pm

    SSL_get_verify_result doesnot do a hostname mismatch search. We have to do that manually taking into consideration multiple CN’s and subject alternative names(SAN’s) that come in the certificate.

    The functions that can be used for handling multiple CN’s are :

    int lastpos = -1;
    lastpos=X509_NAME_get_index_by_NID(X509_get_subject_name(cert), NID_commonName, lastpos);
    X509_NAME_get_entry(X509_get_subject_name(cert), lastpos);
    

    calling X509_NAME_get_index_by_NID again using the new lastpos will give us the next CN until it returns -1 which says there are no more CN’s available.

    this function gives a X509_NAME_ENTRY *, which can be converted to char * using ASN1_STRING_to_UTF8.

    Be sure to consider the wildcards that come in the SAN’s and CN’s

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

Sidebar

Related Questions

How to catch all characters after domain name as one parameter with mod_rewrite? I
I want to catch every request that comes in on my domain name and
I'm developing a simple app in c#, that can check if a domain name
Using Google Apps for your Domain, is it possible to set up a catch-all
I'm trying to catch a JSON object with a mouse click event. I use
I'd like to catch exception which occurs when somebody gives not a number value
How to catch return hit (enter) on TextBox? The following does not work. I
I wish to canonicalize a domain name, from bar.example.com to www.example.com (well anything that's
I have domain1.tld and domain2.tld. Domain1.tld is the primary domain name and domain2.tld is
Given the following mapping <class name=com.domain.Season table=cm.pub.jsn_mstr> <id name=seasonCode column=season_code length=1/> <property name=name type=string

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.