RDFLib / sparqlwrapper

A wrapper for a remote SPARQL endpoint
https://sparqlwrapper.readthedocs.io/
Other
520 stars 122 forks source link

Added support for custom SSL/TLS certificates #147

Open syats opened 4 years ago

syats commented 4 years ago

In order to handle SPARQL endpoints with self-signed certificates, a new parameter was introduced to the init of the Wrapper for a .pem file of the certificate.

dayures commented 4 years ago

@abuonomo @syats these two PR (#135 #147) are quite similar. From your experience, what could be the best and simplest solution?

frankier commented 3 years ago

I vote for this one (and otherwise generally approve this PR -- as far as that helps). The reason is that this way you can use certifi if you want.

e.g.

    import certifi
    from SPARQLWrapper import SPARQLWrapper

    sparql = SPARQLWrapper(endpoint, custom_cert_filename=certifi.where())

This is useful in case of outdated system certificates. Increasingly a problem to the extent that web browsers and the extremely popular Python library requests both bundle their own certificates (requests actually uses certifi).