sfm-docker icon indicating copy to clipboard operation
sfm-docker copied to clipboard

How to set the argument "verify=False" of requests.get function?

Open fishfree opened this issue 5 years ago • 3 comments

In China, we cannot acces Twitter. So I set up a Proxy in the host server, and followed the instruction here, and run up sfm-docker. But it fails with: Last harvest failed. Error messages reported by last harvest: HTTPSConnectionPool(host='api.twitter.com', port=443): Max retries exceeded with url: /1.1/account/verify_credentials.json?tweet_node=extended&tweet_mode=extended (Caused by SSLError(SSLError("bad handshake: Error([('SSL routines', 'tls_process_server_certificate', 'certificate verify failed')],)",),))

However, when I run :

me@sfm:~/sfm-docker$ docker exec -it sfm_twitterstreamharvester_1 /bin/bash root@071c7dfb1df5:/opt/sfm-twitter-harvester# curl https://api.twitter.com

It get response normally as below:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta http-equiv="Content-Language" content="en-us">
    <meta name="robots" content="noindex, nofollow">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Twitter / ?</title>
    .......

So, in which function of which file in which container, I can add the argument "verify=False" in order to neglect the SSL error?

fishfree avatar May 10 '19 06:05 fishfree

Maybe here is a reference.

fishfree avatar May 16 '19 00:05 fishfree

Hi @fishfree, I'm sorry we haven't had a chance to dig into this yet. Thanks for adding the extra reference.

lwrubel avatar May 17 '19 12:05 lwrubel

@lwrubel Thank you! Hope you can reply soon. :-)

fishfree avatar May 22 '19 00:05 fishfree