Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

HTTPS: ignoring Certificates

Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am working on a Project where I need to send Data via HTTPS to a Server.
I learned how to deal with HTTP and HTTPS from your Site, Thanks!
here some Code perhaps it helps to understand my problem:

PrintWriter toServer;
URL url = new URL("https://mysuperfastserver/xxx");
HttpURLConnection urlcon1 = (HttpURLConnection)url.openConnection();
toServer = new PrintWriter(urlcon1.getOutputStream());
Using HTTP works fine but HTTPS
throws NotAfter: Sat Oct 20 20:21:51 CEST 2001
when I want the OutputStream
I understand why: because the SSL-certiciate is an old self-made I added to the trusted ones (keytool -> cacerts)
Now my Question: is there a possibility to ignore the validation of my certificate, a flag or whatever I can set?
Please don't write I need to Buy a valid Cert from Verisign or whatever, I'm just a student that won't be a solution for me!
There could be many Servers, so I don't wan't to Install all the time new self-made certificates!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!