我正在使用Ubuntu 12.04 LTS。 在上傳的Windows Azure帳戶.cer文件中。來自Python的Windows Azure服務管理有證書問題
我的Python腳本是:
#!/usr/bin/python
from azure import *
from azure.servicemanagement import *
azureId = "XXXXXXXXXXXXXXXXXXXXX";
certificate_path= "/home/dharampal/Desktop/azure.pem";
sms = ServiceManagementService(azureId,certificate_path)
print sms
result = sms.list_locations()
print result
當腳本運行到時候讓拋出ServiceManagementService對象,但證書相關的錯誤。腳本的
輸出爲:
<azure.servicemanagement.servicemanagementservice.ServiceManagementService object at 0xb7259f2c>
Traceback (most recent call last):
File "available_locations_list.py", line 13, in <module>
result = sms.list_locations()
File "/usr/local/lib/python2.7/dist-packages/azure/servicemanagement/servicemanagementservice.py", line 796, in list_locations
Locations)
File "/usr/local/lib/python2.7/dist-packages/azure/servicemanagement/servicemanagementclient.py", line 96, in _perform_get
response = self._perform_request(request)
File "/usr/local/lib/python2.7/dist-packages/azure/servicemanagement/servicemanagementclient.py", line 83, in _perform_request
resp = self._filter(request)
File "/usr/local/lib/python2.7/dist-packages/azure/http/httpclient.py", line 144, in perform_request
self.send_request_headers(connection, request.headers)
File "/usr/local/lib/python2.7/dist-packages/azure/http/httpclient.py", line 125, in send_request_headers
connection.endheaders()
File "/usr/lib/python2.7/httplib.py", line 954, in endheaders
self._send_output(message_body)
File "/usr/lib/python2.7/httplib.py", line 814, in _send_output
self.send(msg)
File "/usr/lib/python2.7/httplib.py", line 776, in send
self.connect()
File "/usr/lib/python2.7/httplib.py", line 1161, in connect
self.sock = ssl.wrap_socket(sock, self.key_file, self.cert_file)
File "/usr/lib/python2.7/ssl.py", line 381, in wrap_socket
ciphers=ciphers)
File "/usr/lib/python2.7/ssl.py", line 141, in __init__
ciphers)
ssl.SSLError: [Errno 336265218] _ssl.c:351: error:140B0002:SSL routines:SSL_CTX_use_PrivateKey_file:system lib
我在哪裏做錯了嗎? 如果有人遇到同樣的問題並得到解決方案,請幫助我。 沒有谷歌,但無法找到解決方案。