Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

How to create REST CLIENT for HTTPS in Java?

 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi please help me in this. I am using following code:




but i am getting following response:



I have used InstallCert.java to download certificate from same server and i have put it under security folder of JRE 6/7 both and rerun the program but getting same issue while connecting to server.

Please help me out in finding solution for the same.

Thanks
 
Azrael Noor
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I also used one more code:



but it is displaying:

Even when jssecacerts is present in C:\Program Files\Java\jre6\lib\security folder
 
Rancher
Posts: 43016
76
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So is the certificate now installed properly in the keystore (you can check with keytool)? That Java code you mentioned can do that, but "i have put it under security folder of JRE 6/7" sounds like you did something manually, and it doesn't sound like the right thing to do.

For development purposes something like http://javaskeleton.blogspot.de/2010/07/avoiding-peer-not-authenticated-with.html would work. Don't ever use that across the public internet, though.
 
Any sufficiently advanced technology will be used as a cat toy. And this tiny ad contains a very small cat:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic