不得与授权'10 .137.4.121:8086 WCF Service Svcutil建立SSL/TLS安全渠道的信任关系.NET CORE 3.1?

问题描述 投票:0回答:1
不得与权威建立SSL/TLS安全渠道的信任关系'10 .137.4.121:8086 WCF服务SVCUTIL在项目网络中
我的文件

Reference.cs

private static System.ServiceModel.Channels.Binding GetBindingForEndpoint(EndpointConfiguration endpointConfiguration)
{
        if ((endpointConfiguration == EndpointConfiguration.Service_MDMSSoap))
        {
            System.ServiceModel.BasicHttpBinding result = new System.ServiceModel.BasicHttpBinding();
            result.MaxBufferSize = int.MaxValue;
            result.ReaderQuotas = System.Xml.XmlDictionaryReaderQuotas.Max;
            result.MaxReceivedMessageSize = int.MaxValue;
            result.AllowCookies = true;
            result.Security.Mode = System.ServiceModel.BasicHttpSecurityMode.Transport;

            return result;
        }

        if ((endpointConfiguration == EndpointConfiguration.Service_MDMSSoap12))
        {
            System.ServiceModel.Channels.CustomBinding result = new System.ServiceModel.Channels.CustomBinding();
            System.ServiceModel.Channels.TextMessageEncodingBindingElement textBindingElement = new System.ServiceModel.Channels.TextMessageEncodingBindingElement();
            textBindingElement.MessageVersion = System.ServiceModel.Channels.MessageVersion.CreateVersion(System.ServiceModel.EnvelopeVersion.Soap12, System.ServiceModel.Channels.AddressingVersion.None);
            result.Elements.Add(textBindingElement);
            System.ServiceModel.Channels.HttpsTransportBindingElement httpsBindingElement = new System.ServiceModel.Channels.HttpsTransportBindingElement();
            httpsBindingElement.AllowCookies = true;
            httpsBindingElement.MaxBufferSize = int.MaxValue;
            httpsBindingElement.MaxReceivedMessageSize = int.MaxValue;
            result.Elements.Add(httpsBindingElement);
            return result;
        }
        throw new System.InvalidOperationException(string.Format("Could not find endpoint with name \'{0}\'.", endpointConfiguration));
}

当我致电服务时,我得到上面显示的警报。
Service_MDMSSoapClient sv1 = new Service_MDMSSoapClient(0);
            
ArrayOfXElement a = sv1.GET_READ_IX(tungay, denngay, username, pass);

请帮助我解决这个问题

	

也许您应该添加一些这样的认证:

c# wcf .net-core service
1个回答
0
投票

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.