Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7502339
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T20:49:55+00:00 2026-05-29T20:49:55+00:00

I seem to be having an issue with SSL whenever trying to use oAuth2

  • 0

I seem to be having an issue with SSL whenever trying to use oAuth2 in Python. I’ve spent most of the afternoon attempting to debug it but can’t seem to figure it out.

Here’s my Python Script (Nice and simple):

import oauth2.oauth2 as oauth
import urlparse
import time

## If you're actually processing requests, you'll want this
# import simplejson


### GET A REQUEST TOKEN ###

consumer = oauth.Consumer(key="***KEYHERE***", secret="***KEYSECRETHERE***")

request_token_url = 'https://api.instagram.com/oauth/access_token'

client = oauth.Client(consumer)
resp, content = client.request(request_token_url, "GET")

request_token = dict(urlparse.parse_qsl(content))


token = oauth.Token(request_token['oauth_token'], request_token['oauth_token_secret'])

And these error from the Python Interpreter:

Traceback (most recent call last):
  File "E:\Projects\oAuth2Test\test.py", line 16, in <module>
    resp, content = client.request(request_token_url, "GET")
  File "E:\Projects\oAuth2Test\oauth2\oauth2.py", line 682, in request
    connection_type=connection_type)
  File "E:\Projects\oAuth2Test\httplib2\httplib2.py", line 1445, in request
    (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey)
  File "E:\Projects\oAuth2Test\httplib2\httplib2.py", line 1197, in _request
    (response, content) = self._conn_request(conn, request_uri, method, body, headers)
  File "E:\Projects\oAuth2Test\httplib2\httplib2.py", line 1133, in _conn_request
    conn.connect()
  File "E:\Projects\oAuth2Test\httplib2\httplib2.py", line 914, in connect
    raise SSLHandshakeError(e)
SSLHandshakeError: [Errno 1] _ssl.c:503: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed

Now, just so it’s known, I have my cacerts.txt that came with httplib2 in the proper place and it is found, yet I still have this problem. Any help is appreciated, thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T20:49:57+00:00Added an answer on May 29, 2026 at 8:49 pm

    cacerts.txt contains too few CAs. If you replace it with cacert.pem then there is no ssl error. Here’s a test script:

    #!/usr/bin/env python3
    import http.client
    import ssl
    
    ####context = ssl.create_default_context(cafile='cacerts.txt') # ssl.SSLError
    ####context = ssl.create_default_context(cafile='cacert.pem')  # works   
    context = ssl.create_default_context()  # works as is on the recent versions
    #NOTE: ssl.CERT_REQUIRED is set for the default Purpose.SERVER_AUTH
    
    h = http.client.HTTPSConnection('api.instagram.com', 443, context=context)
    h.request('POST', '/oauth/access_token')
    resp = h.getresponse()
    print(resp.status, resp.reason) # produce expected 400 http error
    print(resp.headers)
    print(resp.read())
    

    As the example demonstrates, the default CA list might be enough on the recent software versions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I seem to be having an issue trying to align an H1 tag
This may seem like a silly question, but we are having an issue debugging
I seem to be having an issue creating an AlertDialog. What I am trying
I'm trying to learn Backbone.js and I seem to be having an issue with
Might seem like a stupid question, but I'm having an issue creating an array
Seem to be having an issue with std::auto_ptr and assignment, such that the object
I am having an issue that I can't seem to figure out. Hopefully somebody
i'm having an issue with creating a query in oracle which doesnt seem to
I am having a strange issue that I can't seem to resolve. Here is
Okay, I seem to be having a problem. I'm trying to create a twicker

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.