• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do I accept a self-signed certificate?

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everyone!

I'm having a problems regarding HTTP connections using SSL, using a self-signed certificate.

The subject is about Android, but I believe that I can find a very good answer here (JavaRanch), although there will be some caveats of Android that I have to keep in mind.

Many articles and topics from forums and blogs, instruct about creating an SSLSocket factory, and set it on the HttpsURLConnection before making connections. But until I just have found pieces of codes (the IntellJ IDE is always complaining: cannot resolve symbol...), and nothing complete.

Does anyone have a COMPLETE EXAMPLE (no missing parts) in Java (JSSE javax.net.ssl.*), about creating a SSLSocket factory for a self-signed certificate, accepting just my certificate, and finally, being able to perform HTTPS requests to my server?

P.S.: I have exported the certificate of my server and created a truststore .BKS.

Any help would be much appreciated.

Thank you very much!
 
reply
    Bookmark Topic Watch Topic
  • New Topic