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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T19:28:45+00:00 2026-06-02T19:28:45+00:00

Like so many here, I’m trying to communicate with a site that has a

  • 0

Like so many here, I’m trying to communicate with a site that has a self-signed cert. There are many many classes and code snippets showing how to do this, e.g. HTTPS GET (SSL) with Android and self-signed server certificate, but I can’t find any that show how to actually use the classes. I’ve experimented a great deal, and I’m sure I’m just missing something simple.

To be specific, I am trying to use the classes supplied by “Moss”; the answer with the most votes. I still always get the “Not trusted cert” message. One other person in that topic has also asked for implementation hints, but has not been answered. Thanks for any help.

If I could append this question to that topic, I’d be much happier, but I guess newbies like me can only post new questions (although I’ve been a fan of SO for over a year).

  • 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-02T19:28:48+00:00Added an answer on June 2, 2026 at 7:28 pm

    We use a similar SocketFactory and X509TrustManager implementation in some of our projects. In order to bind these classes up to your implementation, all you basically should have to do is hook them up to the HttpClient (assuming that’s what you’re using) used for client-server communication.

    We normally have a method to create an HttpClient with the mentioned factory and trustmanager. It looks somewhat like this and is loosely based on the link shown in the inline comments.

    protected HttpClient constructClient() {
        HttpParams params = new BasicHttpParams();
        params.setParameter(CoreProtocolPNames.PROTOCOL_VERSION, HttpVersion.HTTP_1_1);
    
        // use the debug proxy to view internet traffic on the host computer
        if (ABCApplication.isDebuggingProxy()) params.setParameter(ConnRoutePNames.DEFAULT_PROXY, new HttpHost(ABCConstants.DEBUG_PROXY_HOST, ABCConstants.DEBUG_PROXY_PORT, "http"));
    
        // ignore ssl certification (due to signed authority not appearing on android list of permitted authorities)
        // see: http://blog.antoine.li/2010/10/22/android-trusting-ssl-certificates/
        SchemeRegistry registry = new SchemeRegistry();
        registry.register(new Scheme("http", new PlainSocketFactory(), 80));
        registry.register(new Scheme("https", new FakeSocketFactory(), 443)); 
        ClientConnectionManager cm = new SingleClientConnManager(params, registry);
    
        return new DefaultHttpClient(cm, params);
    }
    

    Hope that helps with your implementation.

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

Sidebar

Related Questions

In many documents like here it is described, that old extension points org.eclipse.ui.actionSets ,
Like many people here, I started my programming experience with the good ol' green
It seems like a lot of people here and on many programmer wikis/blogs/ect. elsewhere
I have seen this statement in many of the documention samples, like here This
Like many people, I have several SVN repositories that contains several projects. I've decided
Like many web applications (business) the customer wants a form that will search across
Like many before me, I'm trying so get my derived types to automatically register
Like many, I have spreadsheet that draws data from over 40 text files as
I'm tinkering with an iPad app that (like many iPad apps) doesn't use the
I am first and foremost a perl coder, but like many, also code in

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.