File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 99import hashlib
1010import subprocess
1111import os , os .path
12+ import ssl
1213
1314def subprocess_args (include_stdout = True ):
1415 if hasattr (subprocess , 'STARTUPINFO' ):
@@ -34,6 +35,8 @@ class HelperMethods:
3435
3536 server_address = "https://app.cryptolens.io/api/"
3637
38+ verify_SLL = True
39+
3740 @staticmethod
3841 def get_SHA256 (string ):
3942 """
@@ -119,10 +122,22 @@ def send_request(method, params):
119122
120123 method: the path of the method, eg. key/activate
121124 params: a dictionary of parameters
122- """
123- return urllib .request .urlopen (HelperMethods .server_address + method , \
125+ """
126+
127+ if HelperMethods .verify_SLL :
128+ return urllib .request .urlopen (HelperMethods .server_address + method , \
124129 urllib .parse .urlencode (params )\
125130 .encode ("utf-8" )).read ().decode ("utf-8" )
131+ else :
132+ ctx = ssl .create_default_context ()
133+ ctx .check_hostname = False
134+ ctx .verify_mode = ssl .CERT_NONE
135+
136+ return urllib .request .urlopen (HelperMethods .server_address + method , \
137+ urllib .parse .urlencode (params )\
138+ .encode ("utf-8" ), context = ctx ).read ().decode ("utf-8" )
139+
140+
126141
127142 @staticmethod
128143 def start_process (command , v = 1 ):
You can’t perform that action at this time.
0 commit comments