简体   繁体   中英

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.

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://docs.microsoft.com/en-us/azure/virtual-network/virtual-network-vnet-plan-design-arm
https://docs.microsoft.com/en-us/azure/firewall/overview

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM