Ok. figured it out.

In < 1.5.0 the certificate connection would store an instance variable,
cert_file. This was picked up by LibcloudHTTPSConnection and used to wrap
the connection using an SSLContext.

That code sequence was totally ignored in 2.0 (my bad- but seriously
highlights we need tests for CertificateConnection)

urllib3 (which is what requests uses) has slightly different setup, I'll be
using this submodule to create a HTTPAdapter and mount it into the
connection session so it gets reused, also this should massively speed up
the Azure class.

PR is WIP,
https://github.com/apache/libcloud/pull/1015/files

More reading if you're bored :-)
https://github.com/kennethreitz/requests/blob/master/requests/packages/urllib3/util/ssl_.py

I registered for Azure as well so now I can test it properly.

On Sun, Apr 2, 2017 at 9:57 AM, anthony shaw <anthony.p.s...@gmail.com>
wrote:

> Just tracing this issue now, the API gives me:
>
> <Error xmlns="http://schemas.microsoft.com/windowsazure"; xmlns:i="
> http://www.w3.org/2001/XMLSchema-instance";><Code>ForbiddenError</Code><Message>The
> server failed to authenticate the request. Verify that the certificate is
> valid and is associated with this subscription.</Message></Error>
>
> with the stack trace
>
> Traceback (most recent call last):
>
>   File "test.py", line 9, in <module>
>
>     print(driver.list_nodes('anthonyshaw'))
>
>   File "/Users/anthonyshaw/repo/libcloud/libcloud/compute/drivers/azure.py",
> line 427, in list_nodes
>
>     None
>
>   File "/Users/anthonyshaw/repo/libcloud/libcloud/compute/drivers/azure.py",
> line 1435, in _perform_get
>
>     response = self._perform_request(request)
>
>   File "/Users/anthonyshaw/repo/libcloud/libcloud/compute/drivers/azure.py",
> line 1494, in _perform_request
>
>     raise e
>
> AttributeError: 'NoneType' object has no attribute 'split'
>
> The trace is a bug in the code that it can't figure out the error properly
> (separate issue) but something is going wrong with the certificates.
>
> if I checkout the 1.5.0 tag, then it gives me an empty list (which is
> correct)
>
> On Wed, Mar 8, 2017 at 1:49 AM, Markos Gogoulos <mgogou...@mist.io> wrote:
>
>> Hi all,
>>
>> on a new libcloud (github trunk) I try to run list_nodes() and other
>> functions of Azure (driver azure.py) and it fails. I believe this has to
>> do
>> with httplib_ssl.py and the changes imported there.
>>
>> Has anyone tried to use the Azure driver after the changes on
>> request/respond?
>>
>> Thanks and regards,
>> Markos
>>
>
>

Reply via email to