dse3168 2014-10-16 11:49
浏览 642
已采纳

使用https协议失败的ajax请求的可能原因但http有效

Currently I am working on installing https for a site which is based on codeigniter and apache under Linux environment.

I've checked the configuration of my certificates by https://www.digicert.com/help/ and most pages work fine.

But one page that would require three pages from the same site through jQuery ajax request failed to fetch content from these three sources. In chrome console it show following message.

Failed to load resource: net::ERR_CONNECTION_RESET

or

Failed to load resource: net::ERR_CONNECTION_CLOSED

While the same code and page works perfectly with http protocol.

I usually can see content from 1-2 sources at most. But it can not get all of them successfully.

I modified to preform the ajax request again once it fails. But the failed resource would be simply empty content with http status code 200, which means the browser gets the header successfully but failed to fetch content, or the content originally is empty...

So the issue should be caused by apache configuration for https or something relevant to https.

Another strange thing is IE 10 works fine. But failed on Chrome and FireFox.

I've tried to disable apache module reqtimeout. So I don't think it is caused by longer processing time for https protocol.

And it is not an issue about https call http function, they are all https resources.

If anyone can give me some suggestion for further testing or explanation for possible reason? Thanks in advance.

  • 写回答

1条回答 默认 最新

  • duanfu3390 2014-10-30 08:00
    关注

    In my case, it is a server issue.

    I noticed that I only got trouble with failed ajax or iframe requests on Ubuntu 12.10 installed Apache 2.2.

    The exact same code can run on a testing serve which is ubuntu 14.04 installed Apache 2.4. So that took me some day to transfer all data and service to a new server to fix the problem.

    Since we need the server to run and minimize the cost for server. So I didn't spend a lot of time to figure out what was the reason for the problem.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 数据量少可以用MK趋势分析吗
  • ¥15 使用VH6501干扰RTR位,CANoe上显示的错误帧不足32个就进入bus off快慢恢复,为什么?
  • ¥15 大智慧怎么编写一个选股程序
  • ¥100 python 调用 cgps 命令获取 实时位置信息
  • ¥15 两台交换机分别是trunk接口和access接口为何无法通信,通信过程是如何?
  • ¥15 C语言使用vscode编码错误
  • ¥15 用KSV5转成本时,如何不生成那笔中间凭证
  • ¥20 ensp怎么配置让PC1和PC2通讯上
  • ¥50 有没有适合匹配类似图中的运动规律的图像处理算法
  • ¥15 dnat基础问题,本机发出,别人返回的包,不能命中