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

使用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.

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

报告相同问题?

悬赏问题

  • ¥20 keepalive配置业务服务双机单活的方法。业务服务一定是要双机单活的方式
  • ¥50 关于多次提交POST数据后,无法获取到POST数据参数的问题
  • ¥15 win10,这种情况怎么办
  • ¥15 如何在配置使用Prettier的VSCode中通过Better Align插件来对齐等式?(相关搜索:格式化)
  • ¥100 在连接内网VPN时,如何同时保持互联网连接
  • ¥15 MATLAB中使用parfor,矩阵Removal的有效索引在parfor循环中受限制
  • ¥20 Win 10 LTSC 1809版本如何无损提升到20H1版本
  • ¥50 win10 LTSC 虚拟键盘不弹出
  • ¥30 微信小程序请求失败,网页能正常带锁访问
  • ¥15 Matlab求解微分方程,如何用fish2d进行预优?