Skip to main content

HTTPS for Local Development

 


Switching between HTTP to HTTPS for Local Development

There are millions of developers who write web applications every day. While writing these applications generally they run them locally or in the test environment to test the functionally, before releasing them to production. These applications expose HTTP endpoint using which they can be accessed and tested.


Some times it requires to test the same application using HTTPS. I came across with this use case while working on CloudWatch Metric Streams, where I wanted to send the CloudWatch Metric Streams data to the monitoring solution using Kinesis Data Firehose, and it only accepts HTTPS endpoint. To accomplish the task I wrote one spring boot application. I was running this locally and it was exposing the HTTP endpoint, and the same endpoint can not be used in the Kinesis Data Firehose. It should expose HTTPS Endpoint. 


There are many ways to expose the HTTPS endpoint and using ngrok it can be easily done.


Install ngrok in Ubuntu

  1. Download ngrok for linux from here
  2. unzip download file
    unzip file_name
    
  3. Move ngork to /usr/local/bin/
    mv ngork /usr/local/bin/
    
  4. Test the installation
    ngrok -v
    


Enable HTTPS Endpoint for your Application 


If you have started your application and it is running on http:192.168.30.41:8080 or http:localhost:8080 you have to run the below command to enable HTTPS endpoint


ngrok http 172.31.16.114:8080 
  

above command will provide an HTTPS endpoint something like below 

https://3c956831fb69.ngrok.io


Using the above HTTPS endpoint application can be accessed.


Cheers !!! 😊

Comments

Popular posts from this blog

Running Salt Minion In Docker Container From Scratch  In this post, we will install salt minion in docker container and configure the public IP so it will be reachable from outside. Prerequisites:     Ubuntu host up and running. Public IP should be configured. Docker should be installed. Skip to end of metadata Go to start of metadat PULL UBUNTU DOCKER IMAGE $  docker pull    ubuntu:14.04.5 It will download the Ubuntu docker image. Create a container for salt minion $  docker run -ti --name salt-minion-agent    --net=none --privileged=true ubuntu:14.04.5 bash This will create a container, we will use the same container to install salt minion. Now configure the network for this container. ASSIGNING AN IP FOR A CONTAINER Here I am assuming that host machine is having interface "eth0" with public IP configured.  Name of the container is salt-minion-agent.  The below steps needs to b...
Running Salt Master In Docker Container From Scratch  In this post, we will install salt master in docker container and configure the public IP so it will be reachable from outside. Prerequisites:     Ubuntu host up and running. Public IP should be configured. Docker should be installed. Skip to end of metadata Go to start of metadat Pull Ubuntu docker image $  docker pull   ubuntu:14.04.5 It will download the Ubuntu docker image. Create a container for salt master $  docker run -ti --name salt-master-server   --net=none --privileged=true ubuntu:14.04.5 bash This will create a container, we will use the same container to install salt master. Now configure the network for this container. Assigning an IP for a container Here I am assuming that host machine is having interface "eth0" with public IP configured.  Name of the container is salt-master-server.  The below steps needs to be per...
How to assign static public IP to the docker container   In this post, we will create a docker container and configure the static public IP so it will be reachable from outside. Here we will use the Linux  MAC VLANs and Virtual Ethernets. Prerequisites:     Ubuntu host up and running. Public IP should be configured. Docker should be installed. Skip to end of metadata Go to start of metadat PULL UBUNTU DOCKER IMAGE $  docker pull    ubuntu:14.04.5 It will download the Ubuntu docker image. Create a container $  docker run -ti --name container-1    --net=none --privileged=true ubuntu:14.04.5 bash This will create a docker container, now we will configure the static public ip to the container. ASSIGNING AN IP FOR A CONTAINER Here I am assuming that host machine is having interface "eth0" with public IP configured.  Name of the container is container-1.  The below steps needs to ...