简体   繁体   English

IBM Watson Machine Learning的入站SSL错误

[英]Inbound SSL error with IBM Watson Machine Learning

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. 我在Bluemix上有一个Cloud Foundry应用程序(Python buildpack),它已经成功连接到过去几个月并使用了绑定它的Watson Machine Learning(WML)服务。 Starting this morning, however, I receive a SSL error when trying to call the service. 但是,从今天早上开始,我在尝试呼叫服务时收到SSL错误。 The error could have started prior to today, I just noticed it this morning. 错误可能在今天之前开始,我今天早上才注意到它。

I use Python requests to call WML from the app. 我使用Python请求从应用程序调用WML。 I also tried calling the service using Postman . 我也尝试使用Postman调用该服务。

Here's the relevant Python code (which has worked fine for a few months): 这是相关的Python代码(几个月来一直运行良好):

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? 我的app / client中是否需要进行任何其他配置才能连接到该服务?

Update 更新

I found I was able to call WML successfully by disabling SSL verification (adding verify=False ) on the request. 我发现我能够通过在请求中禁用SSL验证(添加verify=False )来成功调用WML。

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. 我想知道WML最近是否开始使用更新的SSL证书,该证书不在requests正在使用的CA列表中 - 并且无论如何都无法验证。

Update 更新

Found that the SSL certificate has expired. 发现SSL证书已过期。

SSL已过期截图

IBM installed an updated SSL certificate . IBM安装了更新的SSL证书 The connection is working fine now. 连接工作正常。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM