How to Enable SSL for Azure Application Gateway For Scaling Azure Ant Media Solution

Ant Media Server
3 min readDec 30, 2019

--

While setting up a scaling Azure Ant Media Solution, SSL needs to be set up for Azure Application Gateway, which acts as a load balancer.

SSL is required for enabling mic and camera in browsers. Otherwise, WebRTC will not work. In this post, i will explain how to enable SSL for Azure Application Gateway. Application Gateway is used for load balancing in a clustering Azure solution. Please have a look at this document for enabling SSL for standalone servers.

We are going to use Let’s Encrypt for enabling SSL. Let’s Encrypt is a FREE, automated and open Certificate Authority brought to you by the non-profit Internet Security Research Group (ISRG) and supported by big corps such as Google, Facebook, Microsoft, and many others, to have a more secure and privacy-respecting Web.

Create Certificate

1 - Open a terminal.

2 - Install certbot

sudo apt-get install certbot

3 - Executed the following command by writng your email address and your domain.

sudo certbot certonly --email your_email_address -d your_domain --agree-tos --manual

4 - Follow the instructions and press Enter to continue.

5 - After successful operation, terminal output should something like below

Create PFX for Azure Application Gateway

We need a PFX file for Azure Application Gateway and we can create it using openssl by using the files(cert.pem, chain.pem, fullchain.pem, privkey.pem) which are created under /etc/letsencrypt/live/{Your_Domain} in previous step.

Run the below command to have PFX file

sudo openssl pkcs12 -inkey ./privkey.pem -in ./cert.pem -export -out murat.antmedia.io.pfx

Now we have the PFX file.

Create Azure Application Gateway with Certificate for Scaling Azure Ant Media Solution

When creating the Azure Application Gateway, we will provide this certificate.

  • Upload certificate while creating rule (https_5443_edge) rule and provide a name and password for the certificate.
  • While creating the listener for the https_443_origin rule, use the certificate which is previously uploaded.

After that, you can open your Ant Media Server instance with https://your_domain url. For the full guide that describes setting up a clustering solution in Azure, please have a look at this post.

If you have any questions, please drop a line to contact(at)antmedia.io .

References:

This blog post originally published in https://antmedia.io/ssl-for-azure-app-gateway-for-scaling-azure-ant-media/

--

--

Ant Media Server
Ant Media Server

Written by Ant Media Server

Ant Media Server, open source software, supports publishing live streams with WebRTC and RTMP. It supports HLS(HTTP Live Streaming) and MP4 as well.

No responses yet