0

Hi I am not able to connect to APIs in Microsoft Azure management libraries. I am able to retrieve Management Certificate but couldn't make use of Azure management libraries.It is throwing the below error..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<title>Certificate Verification Error</title>

<link rel="stylesheet" href="https://management.core.windows.net/%24%24%24%26%3f%26%3f%24%24%24?cmd=get_file&arg=block_style.css&sid=E782F60E376DB9012C327F2100408E7E60DCD746" type="text/css">

</head>

<body>



<div id="pagecontainer">

        <img class="icon" src="https://management.core.windows.net/%24%24%24%26%3f%26%3f%24%24%24?cmd=get_file&arg=images/block.png&sid=208AEF2DE8AE073BAE795A5F34C2451B3487847E"> <!--Icon for block type-->

        <h1>A certificate verification error occured</h1>



        <div class="row">

                <p class="label">Overview:</p>

                <p class="item">The access to the URL management.core.windows.net is restricted because the validation of the certificate failed</p>

        </div>

        <div class="row">

                <p class="label">Details:</p>

                <p class="item"><b><i>VERIFY DENY: depth=0</i></b>, Client Certificate requested: "management.core.windows.net"</p>

        </div>



        <div id="options">

                <p class="label">Options:</p>

                                

                <form action=""><input type="button" class="button" onclick="history.back();" value="   Go Back   "></form><p class="item">Pressing the button allows you to go to the previous page.</p>

                                <p class="last-item">To find out more about the reason for the block message, please contact your administrator and refer to ID 29.</p>

        </div>



        <div><img class="logo" title="Websense" src="https://management.core.windows.net/%24%24%24%26%3f%26%3f%24%24%24?cmd=get_file&arg=images/wslogo_block_page.png&sid=2C58FBA3B0156FEAD2B6B3E804A651DDB1B26800" alt="Websense Logo">

                <div style="clear: both; overflow: hidden; height:1px;"></div>

        </div>

</div>



</body>

</html>

Please find the code snippet below which i used to list out the services under my azure subscription.

 using (var client = new ComputeManagementClient(
   new CertificateCloudCredentials(subscriptionId,
       new X509Certificate2(Convert.FromBase64String(base64)))
   ))
            {
                var result = client.HostedServices.List();
                result.ToList().ForEach(x => Console.WriteLine(x.ServiceName));
            }
Darrel Miller
  • 139,164
  • 32
  • 194
  • 243
Neel
  • 11
  • 1
  • 3

1 Answers1

0

Ensure that base64 contains the private key of your certificate (not the one coming from .CER file). Also, ensure that the public key (.CER file) is uploaded to your Azure management certificates area under correct subscription id

Igorek
  • 15,716
  • 3
  • 54
  • 92
  • Thanks gorek, later i have found the issue. It was because of the firewall blockage here. After disabling the proxy,It worked :) – Neel Oct 09 '15 at 07:32