当前位置: 首页>>代码示例>>C#>>正文


C# Net.ServicePoint类代码示例

本文整理汇总了C#中System.Net.ServicePoint的典型用法代码示例。如果您正苦于以下问题:C# ServicePoint类的具体用法?C# ServicePoint怎么用?C# ServicePoint使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ServicePoint类属于System.Net命名空间,在下文中一共展示了ServicePoint类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: WebConnectionGroup

		public WebConnectionGroup (ServicePoint sPoint, string name)
		{
			this.sPoint = sPoint;
			this.name = name;
			connections = new ArrayList (1);
			queue = new Queue ();
		}
开发者ID:GirlD,项目名称:mono,代码行数:7,代码来源:WebConnectionGroup.cs

示例2: Invoke

        internal bool Invoke(string hostName,
                             ServicePoint servicePoint,
                             X509Certificate certificate,
                             WebRequest request,
                             X509Chain chain,
                             SslPolicyErrors sslPolicyErrors)
        {
            PolicyWrapper policyWrapper = new PolicyWrapper(m_CertificatePolicy,
                                                            servicePoint,
                                                            (WebRequest) request);

            if (m_Context == null)
            {
                return policyWrapper.CheckErrors(hostName,
                                                 certificate,
                                                 chain,
                                                 sslPolicyErrors);
            }
            else
            {
                ExecutionContext execContext = m_Context.CreateCopy();
                CallbackContext callbackContext = new CallbackContext(policyWrapper,
                                                                      hostName,
                                                                      certificate,
                                                                      chain,
                                                                      sslPolicyErrors);
                ExecutionContext.Run(execContext, Callback, callbackContext);
                return callbackContext.result;
            }
        }
开发者ID:krytht,项目名称:DotNetReferenceSource,代码行数:30,代码来源:ServicePointManager.cs

示例3: CheckValidationResult

 public bool CheckValidationResult(ServicePoint sPoint,
     System.Security.Cryptography.X509Certificates.X509Certificate cert,
     WebRequest wRequest, int certProb)
 {
     // Always accept
     return true;
 }
开发者ID:RavenB,项目名称:gridsearch,代码行数:7,代码来源:Login.cs

示例4: CheckValidationResult

      // ICertificatePolicy
      public bool CheckValidationResult(ServicePoint sp, X509Certificate cert, WebRequest request, int problem) {
         if (problem == 0) {
            // Check whether we have accumulated any problems so far:
            ArrayList problemArray = (ArrayList) request2problems_[request];
            if (problemArray == null) {
               // No problems so far
               return true;
            }

            string problemList = "";
            foreach (uint problemCode in problemArray) {
               string problemText = (string) problem2text_[problemCode];
               if (problemText == null) {
                  problemText = "Unknown problem";
               }
               problemList += "* " + problemText + "\n\n";
            }

            request2problems_.Remove(request);
            System.Console.WriteLine("There were one or more problems with the server certificate:\n\n" + problemList);
            return true;


         } else {
            // Stash the problem in the problem array:
            ArrayList problemArray = (ArrayList) request2problems_[request];
            if (problemArray == null) {
               problemArray = new ArrayList();
               request2problems_[request] = problemArray;
            }
            problemArray.Add((uint) problem);
            return true;
         }
      }   
开发者ID:Nikolay-Krasan,项目名称:DegreeWork,代码行数:35,代码来源:CertPolicy.cs

示例5: TlsStream

        //
        // This version of an Ssl Stream is for internal HttpWebrequest use.
        // This Ssl client owns the underlined socket
        // The TlsStream will own secured read/write and disposal of the passed "networkStream" stream.
        //
        public TlsStream(string destinationHost, NetworkStream networkStream, X509CertificateCollection clientCertificates, ServicePoint servicePoint, object initiatingRequest, ExecutionContext executionContext)
               :base(networkStream, true) {

        // WebRequest manages the execution context manually so we have to ensure we get one for SSL client certificate demand
        _ExecutionContext = executionContext;
        if (_ExecutionContext == null)
        {
            _ExecutionContext = ExecutionContext.Capture();
        }

        // 


         GlobalLog.Enter("TlsStream::TlsStream", "host="+destinationHost+", #certs="+((clientCertificates == null) ? "none" : clientCertificates.Count.ToString(NumberFormatInfo.InvariantInfo)));
         if (Logging.On) Logging.PrintInfo(Logging.Web, this, ".ctor", "host="+destinationHost+", #certs="+((clientCertificates == null) ? "null" : clientCertificates.Count.ToString(NumberFormatInfo.InvariantInfo)));

         m_ExceptionStatus = WebExceptionStatus.SecureChannelFailure;
         m_Worker = new SslState(networkStream, initiatingRequest is HttpWebRequest, SettingsSectionInternal.Section.EncryptionPolicy);

         m_DestinationHost = destinationHost;
         m_ClientCertificates = clientCertificates;

         RemoteCertValidationCallback certValidationCallback = servicePoint.SetupHandshakeDoneProcedure(this, initiatingRequest);
         m_Worker.SetCertValidationDelegate(certValidationCallback);

         // The Handshake is NOT done at this point
         GlobalLog.Leave("TlsStream::TlsStream (Handshake is not done)");
        }
开发者ID:REALTOBIZ,项目名称:mono,代码行数:33,代码来源:_TLSstream.cs

示例6: CheckValidationResult

        public bool CheckValidationResult(ServicePoint sp, 
						   X509Certificate certificate,
						   WebRequest request,
						   int error)
        {
            return true;
        }
开发者ID:Dynalon,项目名称:tomboy-library,代码行数:7,代码来源:OAuthTests.cs

示例7: CheckValidationResult

 public bool CheckValidationResult(ServicePoint sp,
     X509Certificate cert,
     WebRequest req,
     int problem)
 {
     return true;
 }
开发者ID:Nikolay-Krasan,项目名称:DegreeWork,代码行数:7,代码来源:TrustAllCertificatePolicy.cs

示例8: CheckValidationResult

 public bool CheckValidationResult(ServicePoint sp, 
     System.Security.Cryptography.X509Certificates.X509Certificate crt,
     WebRequest req, 
     int problem)
 {
     return true;
 }
开发者ID:josecomboni,项目名称:csharp_binding_v1,代码行数:7,代码来源:TrustAllCertificatesPolicy.cs

示例9: CheckValidationResult

        public bool CheckValidationResult(ServicePoint sp, X509Certificate cert, WebRequest request, int problem)
        {
            if (problem == -2146762487 || problem == 0 || problem == -2146762481)
                return true;

            return false;
        }
开发者ID:menasbeshay,项目名称:ivalley-svn,代码行数:7,代码来源:trustallcer.cs

示例10: BeginGetConnection

 internal IAsyncResult BeginGetConnection(ServicePoint servicePoint, ContextAwareResult outerResult, AsyncCallback callback, object state)
 {
     IAsyncResult result = null;
     try
     {
         this.UpdateServicePoint(servicePoint);
         this.connection = new SmtpConnection(this, this.client, this.credentials, this.authenticationModules);
         this.connection.Timeout = this.timeout;
         if (Logging.On)
         {
             Logging.Associate(Logging.Web, this, this.connection);
         }
         if (this.EnableSsl)
         {
             this.connection.EnableSsl = true;
             this.connection.ClientCertificates = this.ClientCertificates;
         }
         result = this.connection.BeginGetConnection(servicePoint, outerResult, callback, state);
     }
     catch (Exception exception)
     {
         throw new SmtpException(SR.GetString("MailHostNotFound"), exception);
     }
     return result;
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:25,代码来源:SmtpTransport.cs

示例11: CheckValidationResult

 public bool CheckValidationResult(ServicePoint srvPoint,
     X509Certificate certificate, WebRequest request,
     int certificateProblem)
 {
     //Return True to force the certificate to be accepted.
     return true;
 }
开发者ID:innoist,项目名称:GF-FRS,代码行数:7,代码来源:MyPolicy.cs

示例12: CheckValidationResult

            public bool CheckValidationResult(ServicePoint sp, X509Certificate cert,
            WebRequest request, int problem)
            {
                var validationResult = true;
                                
                if (IssuerName != "[email protected]==")
                    if (!cert.Issuer.ToUpper().Contains(IssuerName.ToUpper().Trim())) return false;

                var chain = new X509Chain();


                chain.Build(new X509Certificate2(cert));

                foreach (X509ChainElement e in chain.ChainElements)
                {
                    foreach (X509ChainStatus s in e.ChainElementStatus)
                    {
                        if (((X509ChainStatusFlags.Revoked | X509ChainStatusFlags.NotTimeValid
                            | X509ChainStatusFlags.NotSignatureValid | X509ChainStatusFlags.InvalidExtension
                            | X509ChainStatusFlags.NotValidForUsage | X509ChainStatusFlags.Cyclic) & s.Status) == s.Status)
                        {
                            validationResult = false;
                        }
                    }
                }

                return validationResult;
            }
开发者ID:sreenandini,项目名称:test_buildscripts,代码行数:28,代码来源:Certificate.cs

示例13: WebConnectionGroup

		public WebConnectionGroup (ServicePoint sPoint, string name)
		{
			this.sPoint = sPoint;
			this.name = name;
			connections = new LinkedList<ConnectionState> ();
			queue = new Queue ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:7,代码来源:WebConnectionGroup.cs

示例14: CheckValidationResult

 public bool CheckValidationResult(
     ServicePoint srvPoint,
     X509Certificate certificate,
     WebRequest request,
     int certificateProblem)
 {
     return true;
 }
开发者ID:ejarlewski,项目名称:reyna.net,代码行数:8,代码来源:AcceptAllCertificatePolicy.cs

示例15: CheckValidationResult

        public bool CheckValidationResult(ServicePoint service_point,
		                                   X509Certificate certificate,
		                                   WebRequest request,
						   int problem)
        {
            Log.Warning ("Blindly trusting " + request.RequestUri);
            return true;
        }
开发者ID:nathansamson,项目名称:F-Spot-Album-Exporter,代码行数:8,代码来源:BlindTrustCertificatePolicy.cs


注:本文中的System.Net.ServicePoint类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。