请把代码粘贴在这里
今天搭建了一个建议的Nodejs服务器,可是使用cocos2dx的HttpClient进行请求无法报错,不知为何,求解答。
请求部分代码如下:
HttpClient* hClient = HttpClient::getInstance();
HttpRequest * hRequest = new HttpRequest();
hRequest->setRequestType(cocos2d::network::HttpRequest::Type::GET);
hRequest->setTag(StringUtils::format("%d", type).c_str());
hRequest->setUrl(“https://127.0.0.1:8888/”);
hRequest->setResponseCallback(CC_CALLBACK_2(CLoginHttp::onHttpRequestCompleted, this));
hClient->send(hRequest);
hRequest->release();
代码测试官网请求网址返回正确数据,可是请求自己用nodejs做的服务器时就返回如下错误:
In the constructor of HttpClient!
2015-12-03 1833.992 Cocos3Game2-mobile Starting to load https://127.0.0.1:8888/
2015-12-03 1834.209 Cocos3Game2-mobile CFNetwork SSLHandshake failed (-9806)
2015-12-03 1834.209 Cocos3Game2-mobile NSURLSession/NSURLConnection HTTP load failed (kCFStreamErrorDomainSSL, -9806)
CLoginHttp::onHttpRequestCompleted, httpTag = 5
HTTP Status Code: -1, tag = 5
response failed
error buffer: An SSL error has occurred and a secure connection to the server cannot be made.
请哪位大神指教。
谢谢!!!