File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes How to get https url ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to get https url ?" Watch "How to get https url ?" New topic

How to get https url ?

vijay Panner
Ranch Hand

Joined: Sep 29, 2010
Posts: 30

I used request.getRequestURL() in servlet, it returns only http url alone. but i want to get https url also , how to get it by using servlet? please help me.
Vishal Trivedi
Ranch Hand

Joined: Sep 05, 2011
Posts: 57

I am not sure sure but it has to be done from your configuration xml.
Piyush Joshi
Ranch Hand

Joined: Jun 10, 2011
Posts: 207

I think for that you will also have to get a SSL Certificate.
I also wanted to know in detail how https works.
Any experienced ranchers please guide.

Thanks in advance.

Ove Lindström
Ranch Hand

Joined: Mar 10, 2008
Posts: 326

This is how to setup SSL for Tomcat.

Other appservers has other ways to do it, but all have that in common that you need to generate a certificate (suitable for dev) or buy one from a CA (suitable for production).
I agree. Here's the link:
subject: How to get https url ?
It's not a secret anymore!