NCATS-Gamma / robokop

Master UI for ROBOKOP
MIT License
15 stars 3 forks source link

Omnicorp API fails with SSL error #561

Open DnlRKorn opened 3 years ago

DnlRKorn commented 3 years ago

The following code causes an error in the Omnicorp API, which is catalogued here https://robokop.renci.org/ranker/apidocs/

import requests
r = requests.get("https://robokop.renci.org/ranker/api/omnicorp/MONDO:0005015/CHEBI:6801/", verify=False)
print(r)

#This should fail. The default behavior is verify=True.
r = requests.get("https://robokop.renci.org/ranker/api/omnicorp/MONDO:0005015/CHEBI:6801/")
print(r)

When this code was run on my machine, the following error occurred

raise SSLError(e, request=request) requests.exceptions.SSLError: HTTPSConnectionPool(host='robokop.renci.org', port=443): Max retries exceeded with url: /ranker/api/omnicorp/MONDO:0005015/CHEBI:6801/ (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))

I've done some small amount of exploration on this issue. My findings indicate that somehow the SSL cert on the API backend is incorrectly set up (this is just from a little bit of exploration in the error message). Here is some documentation from Swagger on configuring an SSL cert https://support.smartbear.com/swaggerhub/docs/enterprise/config/ssl/certificate.html

patrickkwang commented 3 years ago

We had a similar issue with ICEES in the past, where Python failed to validate the SSL certificate (you can still reach this by using a browser). In that instance, RENCI IT updated the certificates and the problem was fixed.

YaphetKG commented 3 years ago

Certificate is reconfigured. This is working now.