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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:18:40+00:00 2026-06-05T18:18:40+00:00

I need to build a keystore with all the needed SSL certificates to make

  • 0

I need to build a keystore with all the needed SSL certificates to make my Android app connect to a webserver via https.

This is my certificate chain (obtained with openssl s_client -connect www.myhost.com:443):

 0 s:/C=US/ST=State/L=Location/O=Organization/OU=Webserver Team/CN=www.myhost.com
   i:/C=US/O=Thawte, Inc./CN=Thawte SGC CA - G2
 1 s:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5
   i:/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
 2 s:/C=US/O=Thawte, Inc./CN=Thawte SGC CA - G2
   i:/C=US/O=VeriSign, Inc./OU=VeriSign Trust Network/OU=(c) 2006 VeriSign, Inc. - For authorized use only/CN=VeriSign Class 3 Public Primary Certification Authority - G5
 3 s:/C=US/O=thawte, Inc./OU=Terms of use at https://www.thawte.com/cps (c)06/CN=thawte Extended Validation SSL CA
   i:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA
 4 s:/C=US/O=thawte, Inc./OU=Certification Services Division/OU=(c) 2006 thawte, Inc. - For authorized use only/CN=thawte Primary Root CA
   i:/C=ZA/ST=Western Cape/L=Cape Town/O=Thawte Consulting cc/OU=Certification Services Division/CN=Thawte Premium Server CA/emailAddress=premium-server@thawte.com

My problem is that I’m not 100% sure about how to create the keystore to import in my android application. I’ve only been able to download VeriSign Class 3 Public Primary Certification Authority - G5 and Thawte Primary Root CA from the Thawte and Verisign website. I can’t find the other two that If I’m not wrong should be Thawte SGC CA - G2 and thawte Extended Validation SSL CA.

If I had all of them, I would proceed creating a keystore with the procedure explained in this answer to a question similar to this one.

Am I misunderstanding something? Do I really need all the 4 certificates or not? I’m also not sure of the order (and the aliases) I should use when adding these certificates to the keystore. Does it matter?

  • 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-05T18:18:43+00:00Added an answer on June 5, 2026 at 6:18 pm

    In the end, my problem was that the server was not sending the certificates in the right order (you can see it from the openssl output I posted in my question). The solution was to subclass X509TrustManager and, on method checkServerTrusted, just reorder the certificate chain before passing it to the super implementation. The reordering code is the following:

        int currIndex;
        for (currIndex = 0; currIndex < certificates.length; ++currIndex) {
            boolean foundNext = false;
            for (int nextIndex = currIndex + 1; nextIndex < certificates.length; ++nextIndex) {
                if (certificates[currIndex].getIssuerDN().equals(certificates[nextIndex].getSubjectDN())) {
                    foundNext = true;
                    // Exchange certificates so that 0 through currIndex + 1 are in proper order
                    if (nextIndex != currIndex + 1)  {
                        X509Certificate tempCertificate = certificates[nextIndex];
                        certificates[nextIndex] = certificates[currIndex + 1];
                        certificates[currIndex + 1] = tempCertificate;
                    }
                    break;
                 }
             }
             if (!foundNext) break;
         }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i try to build an https client for android and i need do get
I need to build an url like this: /products/myproductdescription/5; it works except when the
I need to build the latest OpenSSL (1.0.0g) for an Android application. I am
I need to build a small private app. I want to store a piece
I need to build a window designed to look exactly like this (it has
I need to build a XML file of my SQL table. This is my
hello expert, i need build app that share mobile app to second mobile so
I need to build a little wizard that looks like this where you walk
I need to build an app (PHP/MySQL but I don't think it matters), letting
I need to build up the matrix of matrices. Say, for all $1\leq i,j\leq

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.