Note that there are some explanatory texts on larger screens.

plurals
  1. POHow do I authenticate a management service request to Windows Azure?
    primarykey
    data
    text
    <p>I am trying to make a request to Azure via Python to list the storage services I have. </p> <p>My base code is this:</p> <pre><code>import httplib conn = httplib.HTTPSConnection('management.core.windows.net') conn.request('GET', '/[subscription id]/services/storageservices/') response = conn.getresponse() print response.status response.reason </code></pre> <p>Obviously, because I did not authenticate, this printed out <code>403 Forbidden</code></p> <p>So, I followed the instructions at <a href="http://msdn.microsoft.com/en-us/library/windowsazure/gg651127" rel="nofollow noreferrer">http://msdn.microsoft.com/en-us/library/windowsazure/gg651127</a> to create a cert, giving me <code>cert.cer</code>. I uploaded my <code>.cer</code> to my Azure account and copied the <code>.cer</code> to my Linux VM in which I am using Python. I modified my code to be:</p> <pre><code>import httplib cert_file = '/path/to/cert.cer' conn = httplib.HTTPSConnection('management.core.windows.net', cert_file = cert_file) conn.request('GET', '/[subscription id]/services/storageservices/') </code></pre> <p>and got the error:</p> <pre><code>ssl.SSLError: [Errno 336265225] _ssl.c:351: error:140B0009:SSL routines:SSL_CTX_use_PrivateKey_file:PEM lib </code></pre> <p>Under the impression that maybe this was because I was trying to use a <code>.cer</code> certificate instead of a <code>.pem</code>, and based on what is said <a href="https://serverfault.com/questions/9708/what-is-a-pem-file-and-how-does-it-differ-from-other-openssl-generated-key-file">here</a> about the difference between .pem's and .cer's <em>(that they're the same thing with a different extension)</em>, I just changed the extension on my .cer to a .pem and tried again, getting the same error. </p> <p>How can I properly authenticate myself to Azure to access its API? Is this an issue with how I am uploading the certificate, or do I need to do something with the certificate to make it suitable to present to the server? On Windows it seems I can install the <code>.cer</code> into some sort of certificate store - is there an equivalent in Linux from which I need to retrieve the cert before using it to authenticate? Thanks for any help =)</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload