• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

How to Convert REST API from HTTP to HTTPS?

 
Greenhorn
Posts: 26
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Folks,

I want to secure REST API, which is build using Spring Boot.

I want that API should be accessible by HTTPS.

Please Help me out how to achieve this in Spring Boot.

Thank you
 
Bartender
Posts: 7488
171
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't know that that has anything to do with Spring. The server running the WS needs to have HTTPS enabled; does it?
 
Mahesh Suryawanshi
Greenhorn
Posts: 26
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Tim Moores wrote:I don't know that that has anything to do with Spring. The server running the WS needs to have HTTPS enabled; does it?



I think its need to Enable HTTPS in Spring Boot, do configuration stuff to implement SSL.
 
 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Many times this goes hand and hand with secure certificates. Secure certificates are usually applied to either the FQDN (Fully Qualified Domain Name) and/or the web server.
You can generate your own secure certificate, however if this is for public consumption then you will most likely need to spend some money and get a certificate from a Certificate Authority such as GeoTrust.
Once you have the secure certificate setup on the domain/web site then it is usually a matter of making sure that the ports (default SSL is 443) is mapped to the correct web site/domain.
After all of that you can access the content via HTTPS and HTTP. If you want to only allow HTTPS then you will need to do change some web server configurations/settings.

Usually the Certificate Authority has start to finish instructions on how to get the certificate installed on common web servers such as:
  • IIS (Internet Information Server by Microsoft)
  • Apache
  • NGinx
  • etc

  • Start to finish you can usually get the secure certificate from a Certificate Authority within a few hours or less.
    Usually commercially available secure certificates have an expiry date. Generally if you pay more the certificate last longer, but this is not always the case.
     
    Greenhorn
    Posts: 2
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator
    Converting a REST API to https I wont recommend , instead you can make your domain secure using https . But if you still want to do it using spring boot its pretty simple and easy stps.

    1. Generate a Self Signed Certificate .Jks file
    2. Put it in your class path

    then update the following configuration .



    Have a look at the source code down below with details .

    https://frugalisminds.com/how-to-configure-ssl-in-spring-boot-2/
     
    reply
      Bookmark Topic Watch Topic
    • New Topic