• 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
  • Ron McLeod
  • Tim Cooke
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Jeanne Boyarsky
Saloon Keepers:
  • Stephan van Hulst
  • Carey Brown
  • Tim Holloway
  • Piet Souris
Bartenders:

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: 43076
77
  • 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.
 
They weren't very bright, but they were very, very big. Ad contrast:
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
reply
    Bookmark Topic Watch Topic
  • New Topic