@@ -85,7 +85,6 @@ def __init__(self, config):
85
85
self .crawler_list = []
86
86
self .hosts_map = {}
87
87
self .TorExitNodes = []
88
- self .certs_tofu = LimitedSizeDict (size_limit = config .ssl_tofu_cache_size )
89
88
90
89
self .load_lists ()
91
90
@@ -143,17 +142,6 @@ def remote_get_tor_exits_list(self):
143
142
def remote_get_hosts_map (self ):
144
143
return dict (self .hosts_map )
145
144
146
- def remote_is_https (self , hostname ):
147
- return hostname in self .certs_tofu
148
-
149
- def remote_verify_tls_tofu (self , hostname , cert ):
150
- h = hashlib .sha512 (cert ).hexdigest ()
151
- if hostname not in self .certs_tofu :
152
- self .certs_tofu [hostname ] = h
153
- return True
154
-
155
- return self .certs_tofu [hostname ] == h
156
-
157
145
def remote_update_stats (self , onion ):
158
146
self .stats .update (onion )
159
147
@@ -323,9 +311,6 @@ def __init__(self, reactor,
323
311
connectTimeout , bindAddress , pool )
324
312
325
313
def _getEndpoint (self , scheme , host , port ):
326
- def verify_tofu (hostname , cert ):
327
- return rpc ("verify_tls_tofu" , hostname , cert )
328
-
329
314
if scheme not in ('http' , 'https' ):
330
315
raise SchemeNotSupported ("Unsupported scheme: %r" % (scheme ,))
331
316
@@ -344,7 +329,7 @@ def verify_tofu(hostname, cert):
344
329
host ,
345
330
port ,
346
331
config .socksoptimisticdata )
347
- return TLSWrapClientEndpoint (HTTPSVerifyingContextFactory (host , verify_tofu ),
332
+ return TLSWrapClientEndpoint (HTTPSVerifyingContextFactory (host ),
348
333
torSockEndpoint )
349
334
else :
350
335
if scheme == 'http' :
@@ -365,12 +350,8 @@ def request(self, method, uri, headers, bodyProducer=None):
365
350
"""
366
351
parsedURI = URI .fromBytes (uri )
367
352
368
- is_https = yield rpc ("is_https" , parsedURI .host )
369
-
370
- scheme = 'https' if is_https else 'http'
371
-
372
353
for key , values in headers .getAllRawHeaders ():
373
- fixed_values = [re_sub (rexp ['w2t' ], r'' + scheme + r' ://\2.onion' , value ) for value in values ]
354
+ fixed_values = [re_sub (rexp ['w2t' ], r'http ://\2.onion' , value ) for value in values ]
374
355
headers .setRawHeaders (key , fixed_values )
375
356
376
357
try :
0 commit comments