2016-08-23 46 views
0

请求时,我创建http请求它的工作原理与此:HTTPS与ClientResource

ClientResource resource = new ClientResource(protocol + "://localhost:" + port + path); 

然而,当我创建https请求我得到这个错误:

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客户端。

任何想法?

回答

0

问题与证书有关。我设置了一个信任密钥库,并将其用于我的示例。