通过https调用在本地主机上运行的Owin服务

时间:2020-08-19 07:00:03

标签: jquery ssl-certificate owin self-hosting

我有一个基于Microsoft.Owin.Hosting的Web服务,通​​过https在本地端口8443上运行。我已将证书绑定到它,并且能够使用Web服务器地址https:// localhost:8443 / queryendpoint使用Chrome进行连接。我想用该计算机上的客户端浏览器页面中运行的脚本来调用Web服务。

$.ajax({
        headers:{
            "Accept":"application/json",
            "Content-type":"application/x-www-form-urlencoded"
        },
        type: "GET",
        "rejectUnauthorized": false, 
        url:"https://localhost:8433/queryendpoint",
        success:function(response){
          var r=JSON.parse(response);
.
.
.
        }
      }); 

脚本运行时会导致错误: GET https://localhost:8433/queryendpoint net::ERR_CONNECTION_REFUSED

错误还会再次出现,从Postman调用Web服务器地址。

是什么原因导致此错误,我该如何解决?

1 个答案:

答案 0 :(得分:0)

通过指定正确的端口解决了该问题。 :/

相关问题