1

我正在尝试通过使用 Secure Gateway 使其中一项 Watson 服务在本地可用。它适用于基本 HTTP 流量,但我怀疑如何在 API 端点“ https://gateway.watsonplatform.net/conversation/api/v1 ”上配置例如 Watson Conversation 服务的 HTTPS 流量

我已将服务中的目标配置为:gateway.watsonplatform.net,目标端口 443 和客户端侦听端口 6554 - 协议 HTTPS。尽管在 Bluemix 中使用标准基本身份验证和来自服务的凭证,但通过 Postman 连接只会在我的客户端中产生以下结果:

[2017-08-26 12:51:01.626] [INFO] (Client ID LilwbDOdR61_4Am) Connection #1 to gateway.watsonplatform.net:443 was closed

我还尝试将协议配置为 TCP,但这会产生相同的结果。有什么提示吗?

使用 loglevel TRACE 我得到: [2017-09-09 15:05:06.481] [DEBUG] (Client ID LilwbDOdR61_PlY) 向服务器发送反向目标连接 [2017-09-09 15:05:06.833] [TRACE] (客户端 ID LilwbDOdR61_PlY)连接 #1 接收到的数据:361 字节 [2017-09-09 15:05:07.285] [错误](客户端 ID LilwbDOdR61_PlY)连接 #1 到目标 gateway.watsonplatform.net:443 有错误:错误:写入结束后 [2017-09-09 15:05:07.289] [DEBUG](客户端 ID LilwbDOdR61_PlY)到 gateway.watsonplatform.net:443 的连接 #1 已结束 [​​2017-09-09 15:05:07.289] [INFO] (客户端 ID LilwbDOdR61_PlY)到 gateway.watsonplatform.net:443 的连接 #1 已关闭 [2017-09-09 15:05:07.290] [DEBUG](客户端 ID LilwbDOdR61_PlY)关闭连接并从阵列中删除 [2017-09-09 15:05:07.291] [调试](客户端 ID LilwbDOdR61_PlY)clearConnectionArray:0

4

1 回答 1

2

托马斯,我已经设法使用安全网关连接到对话服务。

  1. 对于用户/应用程序协议,使用 TCP
  2. 目的端认证,选择“目的端”,不需要上传任何证书。

配置屏幕将如下所示: 在此处输入图像描述

最后,请求必须使用http而不是 https,这是因为您将安全连接留给了安全网关服务器管理。

您可以像这样测试请求:curl -X POST 'http://localhost:10001/conversation/api/v1/workspaces/<YOUR_WORKSPACE_ID>/message/?version=2017-05-26' -H 'authorization: Basic <ENCODED_CREDENTIALS>' -H 'cache-control: no-cache' -H 'content-type: application/json' -d '{"input": {"text": "hello"}}'

于 2017-11-17T18:18:18.170 回答