Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HTTPS: ignoring Certificates

marek duda
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!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic