This forum is now read-only. Please use our new forums at

Introduction to Twitter's API Forum

View Course » View Exercise

932 points
Submitted by
over 4 years ago

Certificate verify failed


I thought I did everything as asked and added the generated keys and secrets in place of the placeholders "YOUR CONSUMER_KEY" etc.

consumer_key =
access_token =

But whenever I run it, I get the response:

SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed

What might be wrong? Do I have to change something else within the script?

11 votes


I had to change VERIFYPEER to VERIFYNONE for it to work.

151 points
Submitted by
Piaso B
over 4 years ago


Dd44282b013732242e8508c3c7e66c1f?s=140&d=retro lkilian over 4 years ago

Thanks. That works for me as well.

89194c675ab57ccb369235e85afab805?s=140&d=retro Janelle Hinds over 4 years ago

Did you get a 401 error?

512da13d22cc05c3b30073d2_893580913 Sanket Patel over 4 years ago

What is the purpose of VERIFYPEER, how does it work?
Why setting it to VERIFY
NONE made this work?

5e9b47c973ad74b94b1b445956d4cdc5?s=140&d=retro courseRockstar68051 over 4 years ago

I second that.

51b76346631fe907fc00d3bf_976929824 Angeliki-Iro Fragkou-Argyriou over 4 years ago

thanks :)

1 vote


Just wanted to bump this because changing VERIFYPEER to VERIFYNONE worked for me also. Would like to know what the difference is, and/or, at the very least why this works to get around the error posted by the OP.

646 points
Submitted by
Matt Mazur
over 4 years ago

1 vote


Bumping this. Apparently an API change leaves this exercise still broken, but the fix posted above worked for me

1148 points
Submitted by
John Ireton
over 4 years ago

0 votes


I'm getting the same error. Twitter changed their API this week, but I'm not sure if that's what is causing this problem. Hopefully someone who knows can chime in.

1185 points
Submitted by
over 4 years ago