Skip to content

Https in Spring Boot as both server and client using RestTemplate

Notifications You must be signed in to change notification settings

fauzimh/RestTemplateHttps

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rest Template with Https

This repo demonstrate how to use RestTemplate to call https and http.

This maven project contains 2 sub-modules:

  • rest-template-client
  • rest-template-server

Rest Template Server

rest-template-server runs on 2 ports:

  • Port 443 for https
  • Port 80 for http

Server does not authenticate client

Rest Template Client

rest-template-client will call both https and https.

When calling https, client:

  • will accept all certs
    This means, client does not care if the cert is not authenticated by the Certificate Authority(CA).

  • would not validate hostname
    Client does not care whether the hostname it is calling matches with the cert the server is sending.
    To enable hostname validation, remove the NoopHostnameVerifier from the spring active profile in application.properties.

About

Https in Spring Boot as both server and client using RestTemplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published