FabiUnne/youtube-upload

SSL error with Pycurl...

Closed this issue · 6 comments

= Versions

youtube-upload: 0.7.1
python:  ActivePython 2.7.2.5
python-gdata: 2.0.17
pycurl : 7.19.0 (installed pycurl-7.19.0.win32-py2.7 from 
http://www.lfd.uci.edu/~gohlke/pythonlibs/#pycurl)

= Describe the steps (including the command you run) that will reproduce
the problem?
With --api-upload I don't have any issue in uploading. But with Pycurl I get 
following error.,

C:\youtube-upload-0.7.1\youtube_upload>python youtube_upload.py 
--email=test@gmail.com --password=xxxxx --wait-processing --title="test06" 
--description="test01" --category=Entertainment --private --keywords="test" 
C:\test.mp4
Login to Youtube API: email='test@gmail.com', password='******'
Start upload using a HTTP post: C:\test.mp4
Traceback (most recent call last):                 | ETA:  --:--:--   0.00  B/s
  File "youtube_upload.py", line 450, in <module>
    sys.exit(catch_exceptions(EXIT_CODES, main_upload, sys.argv[1:]))
  File "youtube_upload.py", line 104, in catch_exceptions
    fun(*args, **kwargs)
  File "youtube_upload.py", line 435, in main_upload
    post(data["post_url"], {"file": video_path}, {"token": data["token"]})
  File "youtube_upload.py", line 156, in post
    c.perform()
pycurl.error: (60, 'SSL certificate problem, verify that the CA cert is OK. 
Details:\nerror:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate 
verify failed')

Original issue reported on code.google.com by kuumut...@gmail.com on 5 Nov 2012 at 4:27

By email you said that adding this lines solved the problem:

    c.setopt(c.SSL_VERIFYHOST, 0)
    c.setopt(c.SSL_VERIFYPEER, 0)

However, I am a bit concerned about adding such code to circumvent SSL, it 
poses a security threat for man-in-the-middle attacks (somebody could steal 
your password). Can you perform some additional checking? the question is why 
you get this errors while everybody else does not. Anything special about your 
inet connection? proxies or something?

Original comment by tokland on 5 Nov 2012 at 9:33

Yes, adding 
    c.setopt(c.SSL_VERIFYHOST, 0)
    c.setopt(c.SSL_VERIFYPEER, 0)
resolves the problem. I am using a 3G USB data card for internet connection. No 
proxy or anything. I will test with a different 3G data card and with a DSL 
connection and update you the results.

Original comment by kuumut...@gmail.com on 8 Nov 2012 at 10:23

Original comment by tokland on 28 Nov 2012 at 10:30

  • Changed state: Stalled
Sorry, i'm a bit of a noob. 

Is there a resolution to this issue? I am having the exact same problem as the 
OP. I have just regular cable internet from optimum.

in regards to the fix, i'm not sure where I should add in those lines (assuming 
into youtube_upload.py, but wasn't sure where in the file).

Original comment by giglio.k...@gmail.com on 21 Jan 2013 at 5:26

> Is there a resolution to this issue? 

No, because we should know the reason of the problem, it happens to very few of 
you and I cannot reproduce. I cannot just add those two lines and disable 
secury for everyone.

> in regards to the fix, i'm not sure where I should add in those lines 
(assuming into youtube_upload.py, but wasn't sure where in the file).

yes, that file, just before line "c.perform()", be careful with the indentation.

Original comment by tokland on 21 Jan 2013 at 9:28

Original comment by tokland on 13 May 2014 at 2:55