wood burning stoves 2.0*
The moose likes Web Services and the fly likes HTTPS Rest Call using Jersey 2.4 to LinkedIn Rest Service API Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "HTTPS Rest Call using Jersey 2.4 to LinkedIn Rest Service API" Watch "HTTPS Rest Call using Jersey 2.4 to LinkedIn Rest Service API" New topic
Author

HTTPS Rest Call using Jersey 2.4 to LinkedIn Rest Service API

Steven Romero
Greenhorn

Joined: May 12, 2012
Posts: 3
I have been trying to make a Java Rest Program that can read JSON from the LinkedIn Rest Service API. The LinkedIn Rest Service API uses HTTPS. I have used Firefox to obtain the LinkedIn HTTPS Cert as a .pem file, and imported it into a file call .keystore. I use Jersey's Client API to call the service passing it that same .keystore file. Despite all this I am still getting the same HTTP 401 Unauthorized Exception. I have very little experience when dealing with keystores, truststores, and https call, I would appreciate any help. I have posted relevant the code below. Is there anything I need to change?, Is anyone familiar with the SslConfigurator class of JAX-RS 2.4? Or the LinkedIn Rest Service API. I have tested the LinkedIn Rest API on Postman with an active access token and had no issues.


Vijitha Kumara
Bartender

Joined: Mar 24, 2008
Posts: 3816

Please BeForthrightWhenCrossPostingToOtherSites (Cross posted).

Did you try the proper initialization of SslConfigurator as described in the documentation?


SCJP 5 | SCWCD 5
[How to ask questions] [Twitter]
Steven Romero
Greenhorn

Joined: May 12, 2012
Posts: 3
My bad on the cross-posting (never really understood why it is a problem). That was the first thing I did, and I believe I have configured it according to the doc. I have followed all the proper procedures for importing the CA to the trustStore, and having SSLConfigurator read that. This is a new api, so I may just have to wait for better documentation, or for tutorials online.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: HTTPS Rest Call using Jersey 2.4 to LinkedIn Rest Service API
 
Similar Threads
CertificateException: No name matching <hostname> found.
regarding cacerts from JAVA_HOME\jre\lib\security
Two-way SSL authentication
HTML/Post java.lang.classcastexception
REST client to get link URI's "dynamically" via rel="" values.