2014年10月14日星期二

在用python脚本开windows azure虚机报错:ssl.SSLError: [Errno 336265218] _ssl.c:355: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib

代码:
#coding:utf-8
#!/usr/bin/python
#
from azure import *

from azure.servicemanagement import *

from azure.servicemanagement.servicemanagementservice import ServiceManagementService

subscription_id = '9ffdf972-9f2c-4d25-9e68-6e6eaffd2cd7'

certificate_path = '/home/eagle/azure_demo/azuredemo.pem'

sms = ServiceManagementService(subscription_id, certificate_path)

result = sms.list_locations()

for location in result:

    print(location.name)


在用python脚本开windows azure虚机报错:
ssl.SSLError: [Errno 336265218] _ssl.c:355: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib


发生该问题的原因为:
我使用的linux系统,未创建订阅的管理证书,创建成功后,脚本不会再报错

没有评论:

发表评论