@@ -85,7 +85,6 @@ def __init__(self, config):
8585 self .crawler_list = []
8686 self .hosts_map = {}
8787 self .TorExitNodes = []
88- self .certs_tofu = LimitedSizeDict (size_limit = config .ssl_tofu_cache_size )
8988
9089 self .load_lists ()
9190
@@ -143,17 +142,6 @@ def remote_get_tor_exits_list(self):
143142 def remote_get_hosts_map (self ):
144143 return dict (self .hosts_map )
145144
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-
157145 def remote_update_stats (self , onion ):
158146 self .stats .update (onion )
159147
@@ -323,9 +311,6 @@ def __init__(self, reactor,
323311 connectTimeout , bindAddress , pool )
324312
325313 def _getEndpoint (self , scheme , host , port ):
326- def verify_tofu (hostname , cert ):
327- return rpc ("verify_tls_tofu" , hostname , cert )
328-
329314 if scheme not in ('http' , 'https' ):
330315 raise SchemeNotSupported ("Unsupported scheme: %r" % (scheme ,))
331316
@@ -344,7 +329,7 @@ def verify_tofu(hostname, cert):
344329 host ,
345330 port ,
346331 config .socksoptimisticdata )
347- return TLSWrapClientEndpoint (HTTPSVerifyingContextFactory (host , verify_tofu ),
332+ return TLSWrapClientEndpoint (HTTPSVerifyingContextFactory (host ),
348333 torSockEndpoint )
349334 else :
350335 if scheme == 'http' :
@@ -365,12 +350,8 @@ def request(self, method, uri, headers, bodyProducer=None):
365350 """
366351 parsedURI = URI .fromBytes (uri )
367352
368- is_https = yield rpc ("is_https" , parsedURI .host )
369-
370- scheme = 'https' if is_https else 'http'
371-
372353 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 ]
374355 headers .setRawHeaders (key , fixed_values )
375356
376357 try :
0 commit comments