{"id":1890,"date":"2022-01-27T20:27:55","date_gmt":"2022-01-27T20:27:55","guid":{"rendered":"https:\/\/www.codingfriends.com\/?p=1890"},"modified":"2022-01-27T20:27:57","modified_gmt":"2022-01-27T20:27:57","slug":"azure-gateway-issues-with-wild-card-certificates","status":"publish","type":"post","link":"https:\/\/www.codingfriends.com\/index.php\/2022\/01\/27\/azure-gateway-issues-with-wild-card-certificates\/","title":{"rendered":"Azure gateway issues with wild card certificates"},"content":{"rendered":"\n<p>Within my current company, we are using <a rel=\"noreferrer noopener\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/application-gateway\/overview\" target=\"_blank\">azure application gateway<\/a> to host the application and it is a nice load balancer but with a <a rel=\"noreferrer noopener\" href=\"https:\/\/letsencrypt.org\/\" data-type=\"URL\" data-id=\"https:\/\/letsencrypt.org\/\" target=\"_blank\">let&#8217;s encrypt<\/a> wild card certificate I kept on getting the following message on the &#8220;Backend health&#8221; page where we were trying to use https from the application gateway to the server (keeping things secure is always nice \ud83d\ude42 )<\/p>\n\n\n\n<p><code>The Common Name (CN) of the backend server certificate does not match the host header entered in the health probe configuration (v2 SKU) or the FQDN in the backend pool (v1 SKU). Verify if the hostname matches with the CN of the backend server certificate. To learn more visit -\u00a0<a rel=\"noreferrer noopener\" href=\"https:\/\/aka.ms\/backendcertcnmismatch\" target=\"_blank\">https:\/\/aka.ms\/backendcertcnmismatch<\/a>.<\/code><\/p>\n\n\n\n<p>The main problem is using a wild card certificate e.g. for example.com and a listener pointing to a single subdomain e.g. test.example.com, is that we have to set up &#8220;Health probes&#8221; to confirm that the backend server was actually hosting test.example.com instead of checking example.com.<\/p>\n\n\n\n<p>So, the nginx daemon was running on the linux server using the wild card certificate we generated via <a rel=\"noreferrer noopener\" href=\"https:\/\/azure.microsoft.com\/en-gb\/services\/functions\/#overview\" target=\"_blank\">azure functions<\/a> to generate the let&#8217;s encrypt certificate using the hostname of test.example.com and then setup a health probe on the application gateway as below.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"883\" height=\"712\" src=\"https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_201219.png\" alt=\"\" class=\"wp-image-1892\" srcset=\"https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_201219.png 883w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_201219-300x242.png 300w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_201219-768x619.png 768w\" sizes=\"auto, (max-width: 883px) 100vw, 883px\" \/><\/figure>\n\n\n\n<p>and then the health probe will start to work instead of giving the error above, below are the health probes with a status of 200<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"203\" src=\"https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_202515-1024x203.png\" alt=\"\" class=\"wp-image-1893\" srcset=\"https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_202515-1024x203.png 1024w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_202515-300x60.png 300w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_202515-768x153.png 768w, https:\/\/www.codingfriends.com\/wp-content\/uploads\/2022\/01\/Screenshot_20220127_202515.png 1475w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>If the above doesn&#8217;t help, just shout.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Within my current company, we are using azure application gateway to host the application and it is a nice load balancer but with a let&#8217;s encrypt wild card certificate I kept on getting the following message on the &#8220;Backend health&#8221; page where we were trying to use https from the application gateway to the server &hellip; <a href=\"https:\/\/www.codingfriends.com\/index.php\/2022\/01\/27\/azure-gateway-issues-with-wild-card-certificates\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Azure gateway issues with wild card certificates<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[418],"tags":[],"class_list":["post-1890","post","type-post","status-publish","format-standard","hentry","category-azure"],"_links":{"self":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1890","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/comments?post=1890"}],"version-history":[{"count":1,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1890\/revisions"}],"predecessor-version":[{"id":1894,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/posts\/1890\/revisions\/1894"}],"wp:attachment":[{"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/media?parent=1890"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/categories?post=1890"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codingfriends.com\/index.php\/wp-json\/wp\/v2\/tags?post=1890"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}