betcode-org / betfair

betfairlightweight - Betfair API-NG python wrapper (with streaming)
MIT License
428 stars 148 forks source link

SSLV3_ALERT_HANDSHAKE_FAILURE #523

Closed Sucker-atlegoland closed 1 year ago

Sucker-atlegoland commented 1 year ago

intermittent: SSLV3_ALERT_HANDSHAKE_FAILURE

My evolving system, would be working OK, if it was not for the system crash which seem to send betfairlight python into a loop doing unlimited trades, until I run out of money

Of the last three months , all my problems have been down server issue, which has for one reason or another caused a silly loop doing multi-orders, severally damaging my bank

I don't think Customer_ref would bounce duplications ?

Below I enclosed some of the console log from python betfairlight , as you can see has given SSLV3_ALERT_HANDSHAKE_FAILURE, however unfortunately if this happens to be when placing a trade betfairlight keeps trying without passing control back to my code, also I don’t have the knowledge to dive into betfairlight to stop this

This SSLV3_ALERT_HANDSHAKE_FAILURE error does not happen very often & not always in placeOrders function , so its difficult to know what to do , however over the last few months I would I have had it 4-5 times and mostly on very busy trading days

Today I have improved my code , to say if sys.last_value as been set by python eg. My code or betfairlight then stop the whole program , sledge hammer to crack a nut, but I can’t have it doing this muti-order looping, I hope this stops it, else I will have stop my system and stop with betfair completely

I hope you will take the time to advise & help , as I cant continue with my program , if I run in the fear of this happening, any suggestion would be very welcome to eradicate this.

Because I not low level programmer , I have use betfairlight python to get what I want , but cant find any documentation to help me in this matter further

Thanks

pip show betfairlightweight Version: 2.2.0

Note File "betfairlightweight\endpoints\baseendpoint.py", line 43, in request I have added this into here “if sys.last_value is not None “, now will not do request or post anything more to betfair, but its not the best answer

Traceback (most recent call last): File "urllib3\connectionpool.py", line 665, in urlopen File "urllib3\connectionpool.py", line 376, in _make_request File "urllib3\connectionpool.py", line 994, in _validateconn File "urllib3\connection.py", line 352, in connect File "urllib3\util\ssl.py", line 370, in ssl_wrap_socket File "ssl.py", line 500, in wrap_socket File "ssl.py", line 1040, in _create File "ssl.py", line 1309, in do_handshake ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1108)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "requests\adapters.py", line 439, in send File "urllib3\connectionpool.py", line 719, in urlopen File "urllib3\util\retry.py", line 436, in increment urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.betfair.com', port=443): Max retries exceeded with url: /exchange/betting/json-rpc/v1 (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "betfairlightweight\endpoints\baseendpoint.py", line 36, in request File "requests\api.py", line 119, in post File "requests\api.py", line 61, in request File "requests\sessions.py", line 530, in request File "requests\sessions.py", line 643, in send File "requests\adapters.py", line 514, in send requests.exceptions.SSLError: HTTPSConnectionPool(host='api.betfair.com', port=443): Max retries exceeded with url: /exchange/betting/json-rpc/v1 (Caused by SSLError(SSLError(1, '[SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1108)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "Betfair\trader\Trader_Betfair_PyAuto40.py", line 883, in m_timer3OnTimer File "Betfair\trader\Trader_Betfair_PyAuto40.py", line 1088, in ScanDoB File "myBetfair.py", line 352, in place_ord File "betfairlightweight\endpoints\betting.py", line 507, in place_orders File "betfairlightweight\endpoints\baseendpoint.py", line 43, in request be

liampauling commented 1 year ago

If you are unable or unwilling to implement robust error handling in your code I suggest you look at flumine which is a fully featured trading framework sitting atop betfairlightweight