I have a Cloud Foundry app (Python buildpack) on Bluemix that has been successfully connecting to, and using a Watson Machine Learning (WML) service bound to it for the past few months. Starting this morning, however, I receive a SSL error when trying to call the service. The error could have started prior to today, I just noticed it this morning.
I use Python requests to call WML from the app. I also tried calling the service using Postman.
Here's the relevant Python code (which has worked fine for a few months):
import requests
spssUrl = 'https://palbyp.pmservice.ibmcloud.com/pm/v1/{model}'
spssModelscore = 'score/bikeride'
spssParams = {"accesskey": accessKey, "metadatatype": "score"}
spssHeaders = {"Content-Type": "application/json"}
spssResults = requests.post(spssUrl.format(model = spssModelscore), data=json.dumps(modelPayload), params=spssParams, headers=spssHeaders)
Here's the error I see:
requests.exceptions.SSLError
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:590)
Has anything changed recently? Is there any additional configuration I need to do in my app / client to be able to connect to the service?
Update
I found I was able to call WML successfully by disabling SSL verification (adding verify=False
) on the request.
spssResults = requests.post(spssUrl.format(model = spssModelscore), data=json.dumps(modelPayload), params=spssParams, headers=spssHeaders, verify=False)
Obviously this is not the right way to solve this problem. Any guidance? I wonder if WML recently started using an updated SSL certificate that is not on the CA list that requests
is using -- and somehow cannot be verified.
Update
Found that the SSL certificate has expired.
IBM installed an updated SSL certificate. The connection is working fine now.