【发布时间】:2016-08-23 22:19:40
【问题描述】:
当我为 http 创建请求时,它适用于:
ClientResource resource = new ClientResource(protocol + "://localhost:" + port + path);
但是,当我创建 httpsrequests 时,我收到了这个错误:
Starting the internal [HTTPS/1.1] server on port 8081
Starting the internal HTTP client
A recoverable error was detected (1001), attempting again in 2000 ms.
A recoverable error was detected (1001), attempting again in 2000 ms.
Stopping the internal server
我知道当我们使用Client 对象时,我们应该设置:
Client client = new Client(Protocol.HTTPS);
所以,我怀疑为ClientResource 设置类似的东西。我试过了,但没有解决:
resource.setProtocol(Protocol.HTTPS);
也试过了:
Client client = new Client(Protocol.HTTPS);
resource.setProtocol(Protocol.HTTPS);
resource.setNext(client);
但是我得到了相同的日志。从日志中可以看出,它首先创建了一个 HTTPS 服务器而不是 HTTP 客户端。
有什么想法吗?
【问题讨论】: