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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T12:49:12+00:00 2026-06-11T12:49:12+00:00

I have created my self signed certification and installed it to my client’s Trusted

  • 0

I have created my self signed certification and installed it to my client’s Trusted root and used to .pfx [server side] to confirm that certification and the Authentication is going smoothly without any errors

But there is a question that really confuses me is there any way for a hacker to fake the authentication with my client ? with his fake cert and server ?

Example :

My code to validate the certification is

    private static bool OnCertificateValidation(
        object sender,
        X509Certificate certificate,
        X509Chain chain,
        SslPolicyErrors sslPolicyErrors)
    {
        if (sslPolicyErrors == SslPolicyErrors.None)
        {
            if (CaVerify(chain) && ServerVerify(certificate)) return true;
        }
        return false;
    }

    public static bool CaVerify(X509Chain chain)
    {
        if (chain.ChainElements.Count > 0)
        {
            var certHash = chain.ChainElements[chain.ChainElements.Count - 1].Certificate.GetCertHash();
            if (certHash.Length == ApiCertHash.Length)
            {
                for (var idx = 0; idx < certHash.Length; idx++)
                {
                    if (certHash[idx] == ApiCertHash[idx])
                    {
                        return true;
                    }
                }
            }
        }
        return false;
    }

    public static bool ServerVerify(X509Certificate certificate)
    {
        var certHash = certificate.GetCertHash();

        if (certHash.Length == ApiCertHash.Length)
        {
            for (var idx = 0; idx < certHash.Length; idx++)
            {
                if (certHash[idx] == ApiCertHash[idx])
                {
                    return true;
                }
            }

        }
        return false;
    }

So could some one create a fake certification.pfx and associate it to his fake server and connect my client to his fake server ?

  • 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-11T12:49:13+00:00Added an answer on June 11, 2026 at 12:49 pm

    The Common Name (CN) field of the SSL certificate should be the DNS name of the host you are are trying to connect to. You are “Trusting” the “Trusted Root Certificate Authorites” that they will not issue a certificate with a CN without validating ownership of DNS name listed in the CN.

    You have bypassed this by manually adding a Certificate Authority (CA) to the Trusted list. So the computer trusts your personal CA that the certificate it received from the server is authorized to be used for whatever CN listed on the certificate.

    A attacker can not make a “Fake” certificate as the CA who issued the unauthorized certificate is not “Trusted” so the validation fails.


    This is how coperate proxies often work. The IT department installs a CA on the workstations. When you make a SSL request it goes through the proxy, when the reply comes back the proxy intercepts “CN=*.google.com Signed by VeriSign” and sends to your workstation “CN=*.google.com, Signed by XYZ Corperate Proxy”. Because the IT pre-installed the Trusted Root CA the browser does not complain.

    However if you use some browser that does not use the normal store, or does not have CA installed you would get a certificate error as your computer would see the “Signed by XYZ Coperate Proxy” cert, not know who that CA is, then return RemoteCertificateChainErrors on the sslPolicyErrors argument.


    Code example of checking the CA’s hash.

    if (sslPolicyErrors == SslPolicyErrors.None)
    {
        var apiCertHash = new byte[] { 0x79, 0x04, 0x15, 0xC5, 0xC4, 0xF1, 0x6A, 0xA7, 0xC9, 0x12, 0xBB, 0x23, 0xED, 0x5A, 0x60, 0xA7, 0x92, 0xA8, 0xD5, 0x94 };
        if(chain.ChainElements.Count > 0)
        {
            //Not 100% if the root is first or last in the array. Don't have the program running to check.
            var certHash = chain.ChainElements[chain.ChainElements.Count - 1].Certificate.GetCertHash();
            if (certHash.Length == apiCertHash.Length)
            {
                for (var idx = 0; idx < certHash.Length; idx++)
                {
                    if (certHash[idx] == apiCertHash[idx])
                    {
                        return true;
                    }
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a self-signed certificate on my server. Now I need to import
Hi I have created a Self Signed Applet , but not able to access
I have set up the Apache tomcat 5 to support ssl. Created self signed
I have created a self-hosted wordpress blog and on my ftp server everything is
I have a self-signed digital certificate created using java keytool command. Can I update
I created a self-signed certificate (created using OpenSSL) and installed it into the Certificate
I have created a self signed certificate and of course my website works with
I have created a phonegap app which needs to communicate with a self signed
I am trying to write an https server and client. I have created a
Have you ever created or encountered a self modifying code in Java? If yes,

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.