From d82fa8a6932e7036235c4e9e2d735090fff51c8a Mon Sep 17 00:00:00 2001 From: Santiago Ramirez Date: Wed, 14 Aug 2024 20:51:13 -0400 Subject: [PATCH] reset default values --- quotexpy/api.py | 38 ++++++++++++-------------------------- 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/quotexpy/api.py b/quotexpy/api.py index 6d916f8..ee76955 100644 --- a/quotexpy/api.py +++ b/quotexpy/api.py @@ -6,10 +6,8 @@ import json import pickle import typing -import certifi import logging import urllib3 -import platform import requests import threading @@ -47,12 +45,6 @@ os.environ["WEBSOCKET_CLIENT_CA_BUNDLE"] = cert_path cacert = os.environ.get("WEBSOCKET_CLIENT_CA_BUNDLE") -ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT) -ssl_context.options |= ssl.OP_NO_TLSv1 | ssl.OP_NO_TLSv1_1 | ssl.OP_NO_TLSv1_2 -ssl_context.minimum_version = ssl.TLSVersion.TLSv1_3 - -ssl_context.load_verify_locations(certifi.where()) - class QuotexAPI(object): """Class for communication with Quotex API""" @@ -272,26 +264,20 @@ def start_websocket(self) -> bool: self.websocket_error_reason = None self.websocket_client = WebsocketClient(self) - payload = { - "ping_interval": 25000, - "ping_timeout": 5000, - "ping_payload": "2", - "origin": "https://qxbroker.com", - "host": "ws2.qxbroker.com", - "sslopt": { - "check_hostname": False, - "cert_reqs": ssl.CERT_NONE, - "ca_certs": cacert, - "context": ssl_context, - }, - } - - if platform.system() == "Linux": - payload["sslopt"]["ssl_version"] = ssl.PROTOCOL_TLS - self.websocket_thread = threading.Thread( target=self.websocket.run_forever, - kwargs=payload, + kwargs={ + "ping_interval": 25000, + "ping_timeout": 5000, + "ping_payload": "2", + "origin": "https://qxbroker.com", + "host": "ws2.qxbroker.com", + "sslopt": { + "cert_reqs": ssl.CERT_NONE, + "ca_certs": cacert, + "ssl_version": ssl.PROTOCOL_TLSv1_2, + }, + }, ) self.websocket_thread.daemon = True