weixin_33704591 2015-01-14 21:05 采纳率: 0%
浏览 216

通过https SSL进行Ajax调用

I have a jquery Ajax call trying to call a webmethod. It works for all environment but not once deployed to production. The only difference is production use HTTPS SSL.

Here is my ajax code

$.ajax({
        type: "POST",
        url: "https://www.mywebsite.ca/assure/demandeconfirmee.aspx/EnvoyerAuxAssureurs",
        data: "{}",
        contentType: "application/json; charset=utf-8",
        dataType: 'text',
        success: function (msg) {
        console.log(msg);
        },
    error: function (xhr, ajaxOptions, thrownError) {
        console.log(xhr.status);
        console.log(thrownError);
        }   
    });

and my webmethod

[WebMethod]
public static string EnvoyerAuxAssureurs()
{
    return "YanTest";
}

Doing ajax over https should be straight forward no?!

on every environment i test it I recieve "yanTest" in response.

However, under https (production) I get the following answer (called url is returned in comment..with http instead of https) :

 <html><head><title></title><!-- <script language="javascript">window.location.replace("http://www.mywebsite.ca/assure/demandeconfirmee.aspx/EnvoyerAuxAssureurs");</script> --></head><body></body></html>

Any input?

!!!Problem Solved!!!! Redirect was caused by my WebPageSecurity.dll module that was causing a redirection, I've added the following to my web.config and it now works!

<secureWebPages mode="On" maintainPath="True" warningBypassMode="AlwaysBypass" bypassQueryParamName="BypassSecurityWarning" ignoreHandlers="WithStandardExtensions">
<files>
    <add path="Assure/DemandeConfirmee.aspx/EnvoyerAuxAssureurs" secure="Ignore" />
</files>

  • 写回答

1条回答 默认 最新

  • ?Briella 2015-01-15 14:28
    关注

    !!!Problem Solved!!!! Redirect was caused by my WebPageSecurity.dll module that was causing a redirection, I've added the following to my web.config and it now works!

        <secureWebPages mode="On" maintainPath="True" warningBypassMode="AlwaysBypass" bypassQueryParamName="BypassSecurityWarning" ignoreHandlers="WithStandardExtensions">
    <files>
        <add path="Assure/DemandeConfirmee.aspx/EnvoyerAuxAssureurs" secure="Ignore" />
    </files>
    
    评论

报告相同问题?

悬赏问题

  • ¥50 safari浏览器fetch提交数据后数据丢失问题
  • ¥15 matlab不知道怎么改,求解答!!
  • ¥15 永磁直线电机的电流环pi调不出来
  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真