If you want to use the Azure Management APIs from Linux, there are a few things you need to do so that it will work correctly. If you are getting a problem when you try to connect where it looks like the Azure side is just closing the connection, there are a few things that could be the problem.
There are the standard things that you need to make sure you do:
But assuming those things are all correct, you also need to make sure you use the SSL_CTX_set_mode function to set the following OpenSSL options:
That should allow you to connect to the management APIs.
You can also take a look at this forum post to see how to get curl to connect. This can be really helpful as curl has all of the source code so you can use that to see how to connect.
For more information on how to do this kind of thing from windows, take a look at this MSDN article.