基础连接已关闭:发送中发生意外错误。”使用SSL证书

时间:2018-08-13 14:04:54

标签: c# asp.net .net visual-studio .net-core

public static bool DataCheck(string RefNo, out string region)
{
    region = "";

    try
    {
        string url = "https://plugin.comapny.com/api/DataCheck";

        using (var client = new WebClient())
        {
            Jobvalidation JVObj = new Jobvalidation();
            JVObj.RefNo = RefNo.ToUpper();
            JVObj.ConnectionString = Configration.DMSConfig.Connectionstring;
            JVObj.Zone = Configration.DMSConfig.ZONE;
            client.Headers.Add("Content-Type:application/json");
            client.Headers.Add("Accept:application/json");
            string result = client.UploadString(url, JsonConvert.SerializeObject(JVObj));
            JVObj = JsonConvert.DeserializeObject<Jobvalidation>(result);
            region = JVObj.region;
            bool flag = Convert.ToBoolean(JVObj.flag);
            return flag;
        }
    }
    catch (Exception ex)
    {
        //string result;
        region = "Exception:" + ex.Message;
        return false;
    }
}

当我们从本地计算机访问服务时,我们得到了以上错误。上面是我的代码,您可以为此进行检查和帮助吗?

0 个答案:

没有答案