Galet
Galet

Reputation: 6309

How to configure HTTPs support for application running on Azure VM

I am running my custom application on Azure VM. Now I want to provide HTTPs support using Self-signed certification for my application.

I did the following

  1. Generate a JKS file
$JAVA_HOME/bin/keytool -genkey -alias test -keyalg RSA -keysize 2048 -keystore sample.jks -dname "CN=test,OU=admin,O=sample,L=Redwood City,ST=CA,C=US" -storepass testing -keypass testing
  1. Configure the following property file with above values
redirect_port=443
ssl_port=443
keystore=sample.jks
keystore_password=testing
truststore=sample.jks
truststore_password=testing
  1. Add HTTPs port
firewall-cmd --zone=public --permanent --add-service=https
systemctl restart firewalld

netstat -ln

tcp6       0      0 :::443                  :::*                    LISTEN
  1. When I load the https://myip , It keeps on loading and getting connection time out error after some time.

This site can’t be reached myip took too long to respond.

Update:-

I made it working by myself after adding 443 port in NSG rule. Now it is working.

Upvotes: 0

Views: 133

Answers (1)

4c74356b41
4c74356b41

Reputation: 72191

So 3 moving parts:

  1. application listening (seems you got that covered).
  2. OS level firewall allowing traffic (iptables\whatever)
  3. Azure level firewall allowing traffic (network security group\firewall)

https://learn.microsoft.com/en-us/azure/virtual-network/virtual-network-vnet-plan-design-arm
https://learn.microsoft.com/en-us/azure/firewall/overview

Upvotes: 1

Related Questions