Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SERVICE queries choke on certificate issues #1295

Closed
nicholascar opened this issue Apr 24, 2021 · 2 comments
Closed

SERVICE queries choke on certificate issues #1295

nicholascar opened this issue Apr 24, 2021 · 2 comments

Comments

@nicholascar
Copy link
Member

nicholascar commented Apr 24, 2021

Likely this is a duplicate issue...

In rdflib 6.0.0-dev, this code fails due to urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)>:

import rdflib

g = rdflib.Graph()
qres = g.query(
    """
    SELECT ?s ?o
    WHERE {
      SERVICE <https://dbpedia.org/sparql> {
        ?s a ?o .
      }
    } 
    LIMIT 3
    """
)

for row in qres:
    print(row.s)

...and I can confirm that the above code works for insecure, i.e. HTTP, not HTTPS, SPARQL endpoints.

@nicholascar
Copy link
Member Author

This issue is specific to people running Python 3.6+ on a Mac, like me. It's to do with Python on a Mac not installing the certs, rather than any RDFlib issue, so I'm closing.

@GiveMeMoreData
Copy link

I'm using Python 3.9.6 on Winodws 10, with rdflib version 6.2.0 and I had the same problem as described in this issue. Since this is exactly the problem I had, and it took me some time to find the solution I am posting it here.

import ssl  
ssl._create_default_https_context = ssl._create_unverified_context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants