Home > Programming, Support > Using SSL in RestClient

Using SSL in RestClient

RESTClient is a great little CLI and GUI tool for testing your REST API. I recently pushed a new API up in the office and it runs over SSL. I tried to test it in the RESTClient and got a PeerNotVerified error from Java. First thing I did was go to the SSL tab in RestClient presuming I could tell it to just trust the API…apparently not.

So after a bit of web scouring about how to get Java to trust your site I came across instructions and thought I’d re-post here simplified for anyone who needs to query HTTPS from RESTClient.

These instructions are based on Windows 64-bit and Java being installed into C:\Program Files (x86)\Java. So you may have to change a few paths but the core things are the same.

Navigate to the website in your browser, click the SSL icon in the address bar and click Certificate Information or Details etc.

In the window that pops up, go to the Details tab then click the “Copy to File” button. Click Next until you get to the request for a Filename. Click Browse and navigate to “C:\Program Files (x86)\Java\jre6\lib\security”. Enter the filename to save the certificate as (I suggest the domain name with .cer ending). Finally click Next and Finish.

Now open up a command prompt (if you’ve got Windows security then be sure to run as administrator [right click the shortcut to the command prompt and the option is there]) and enter the following:

cd "C:\Program Files (x86)\Java\jre6"
bin\keytool.exe -noprompt -import -keystore lib\security\cacerts
     -alias (put_domain_name_here)
     -file lib\security\(name_of_certificate_you_saved_above).cer

The second command should all be on one line. You’ll get asked for a password, if you’ve never touched any Java passwords on your machine before, it’ll probably be the certificate store default which is either changeit or changeme.

That’s it! You should now be able to query your service using HTTPS without any errors.


Related posts:

  1. US Toughens up on incoming planes from “terror-prone” countries

Categories: Programming, Support Tags:
  1. sriram
    July 5th, 2011 at 14:41 | #1

    Hi,

    Can you provide me the how to implement security at REST webservices?

    Thanks & Regards,
    Sriram.

  2. July 9th, 2011 at 11:50 | #2

    @sriram
    What is it you’re looking for exactly?

  3. Gad Hazum
    October 13th, 2011 at 20:18 | #3

    Tried your steps and still getting the same error (PeerNotVerified). Are there additional steps needed when it’s a two-way SSL? We are using client certificate to authenticate so the certificates need to be passed along with the request to the server.

  4. December 5th, 2011 at 18:08 | #4

    ola, eu Achei bom! mas ! quero mais informaçâo!!

  1. No trackbacks yet.

Easy AdSense by Unreal