jupe76 / bmwcdapi

a python script to access the BMW ConnectedDrive portal in openhab
42 stars 12 forks source link

Issue with calling API #6

Closed itchy3344 closed 4 years ago

itchy3344 commented 5 years ago

Hi, I'm receiving this error in Europe (using default URL) when running the python script:

...running bmwcdapi.py Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 343, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 841, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 344, in connect sslcontext=context) File "/usr/lib/python3/dist-packages/urllib3/util/ssl.py", line 344, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.7/ssl.py", line 412, in wrap_socket session=session File "/usr/lib/python3.7/ssl.py", line 853, in _create self.do_handshake() File "/usr/lib/python3.7/ssl.py", line 1117, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='b2vapi.bmwgroup.com', port=443): Max retries exceeded with url: /gcdm/oauth/token (Caused by SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "bmwcdapi.py", line 332, in main() File "bmwcdapi.py", line 296, in main c = ConnectedDrive() File "bmwcdapi.py", line 69, in init self.generateCredentials() File "bmwcdapi.py", line 100, in generateCredentials r = requests.post(url, data=data, headers=headers,allow_redirects=False) File "/usr/lib/python3/dist-packages/requests/api.py", line 116, in post return request('post', url, data=data, json=json, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='b2vapi.bmwgroup.com', port=443): Max retries exceeded with url: /gcdm/oauth/token (Caused by SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)')))

leiweke commented 5 years ago

hello I´m having the same issue: standard OH2.5 installation nothing other then BMW installed.

2019-11-04 22:52:25.126 [INFO ] [ipse.smarthome.model.script.bmwcdapi] - forced connectedDrive API call 2019-11-04 22:52:26.743 [INFO ] [ipse.smarthome.model.script.bmwcdapi] - ...running bmwcdapi.py Traceback (most recent call last): File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 600, in urlopen chunked=chunked) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 343, in _make_request self._validate_conn(conn) File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 841, in _validate_conn conn.connect() File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 344, in connect sslcontext=context) File "/usr/lib/python3/dist-packages/urllib3/util/ssl.py", line 344, in ssl_wrap_socket return context.wrap_socket(sock, server_hostname=server_hostname) File "/usr/lib/python3.7/ssl.py", line 412, in wrap_socket session=session File "/usr/lib/python3.7/ssl.py", line 853, in _create self.do_handshake() File "/usr/lib/python3.7/ssl.py", line 1117, in do_handshake self._sslobj.do_handshake() ssl.SSLError: [SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/python3/dist-packages/requests/adapters.py", line 449, in send timeout=timeout File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 638, in urlopen _stacktrace=sys.exc_info()[2]) File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 398, in increment raise MaxRetryError(_pool, url, error or ResponseError(cause)) urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='b2vapi.bmwgroup.com', port=443): Max retries exceeded with url: /gcdm/oauth/token (Caused by SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/etc/openhab2/scripts/bmwcdapi.py", line 332, in main() File "/etc/openhab2/scripts/bmwcdapi.py", line 296, in main c = ConnectedDrive() File "/etc/openhab2/scripts/bmwcdapi.py", line 69, in init self.generateCredentials() File "/etc/openhab2/scripts/bmwcdapi.py", line 100, in generateCredentials r = requests.post(url, data=data, headers=headers,allow_redirects=False) File "/usr/lib/python3/dist-packages/requests/api.py", line 116, in post return request('post', url, data=data, json=json, kwargs) File "/usr/lib/python3/dist-packages/requests/api.py", line 60, in request return session.request(method=method, url=url, kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 533, in request resp = self.send(prep, send_kwargs) File "/usr/lib/python3/dist-packages/requests/sessions.py", line 646, in send r = adapter.send(request, kwargs) File "/usr/lib/python3/dist-packages/requests/adapters.py", line 514, in send raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='b2vapi.bmwgroup.com', port=443): Max retries exceeded with url: /gcdm/oauth/token (Caused by SSLError(SSLError(1, '[SSL: UNSUPPORTED_PROTOCOL] unsupported protocol (_ssl.c:1056)')))

leiweke commented 5 years ago

here is the solution: https://github.com/bimmerconnected/bimmer_connected/issues/111