• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

How to create REST CLIENT for HTTPS in Java?

 
Ranch Hand
Posts: 385
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43027
76
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic