-2

I have a simple Restful service created using Jersey.

@GET
@Path("{name}")
@Produces(MediaType.TEXT_PLAIN)
public String Greetings(@PathParam(value="name") String name) {
    return "Hello "+name;
}

Now if I access the URL, http://localhost:8082/HPRestServices/rest/information/John, I'm able to hit the service.

My requirement is I want to achieve the same over https://

What is the easiest way to achieve this??

mani_nz
  • 4,522
  • 3
  • 28
  • 37
  • This has nothing to do with REST. It is about server configuration. Why do you want to access `localhost` over HTTPS? –  Jun 20 '14 at 10:58
  • 1
    I tagged Rest because Rest being a URL driven service having https might open up some more issues. Users might help me in that part too. U gave a -1 for that ? uhhhh – mani_nz Jun 20 '14 at 11:06
  • I voted -1 because "This question does not show any research effort; it is unclear or not useful". –  Jun 20 '14 at 12:02
  • 1
    HTTP has nothing to do with SSL. HTTP/S is HTTP over SSL. You problem is to secure a connection over SSL. This can be achieved by fronting any java application with an Apache server set-up as reverse proxy. Voting down for the same reason as @Lutz Horn – Bruno Grieder Jun 20 '14 at 12:12

1 Answers1

0

On TOMCAT:

Open Tomcat/conf/server.xml and paste this tag. Paste it after

< Connector port="8443" protocol="HTTP/1.1" SSLEnabled="true"
           maxThreads="150" scheme="https" secure="true"
           clientAuth="false" sslProtocol="TLS" 
       keystoreFile="d:\keystore"
       keystorePass="mykeypass" />

keystore has the certificate with mykeypass as its password.

Satish
  • 713
  • 1
  • 5
  • 18