Esempio n. 1
0
        // Token: 0x060011FD RID: 4605 RVA: 0x0006D26C File Offset: 0x0006B46C
        private bool CheckAndHandleWebException40X(WebException webException, Exception outerException)
        {
            if (webException.Status != WebExceptionStatus.ProtocolError)
            {
                return(false);
            }
            HttpWebResponse httpWebResponse = (HttpWebResponse)webException.Response;

            if (httpWebResponse.StatusCode == HttpStatusCode.Forbidden)
            {
                OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorSslConnection, base.OwaContext.SecondCasUri.ToString(), new object[]
                {
                    base.OwaContext.LocalHostName,
                    base.OwaContext.SecondCasUri.ToString(),
                    base.OwaContext.SecondCasUri.ToString()
                });
                OwaProxyException exception = new OwaProxyException("The CAS server is most likely not configured for SSL (it returned a 403)", LocalizedStrings.GetNonEncoded(-750997814), outerException, false);
                this.asyncResult.CompleteRequest(false, exception);
                return(true);
            }
            if (httpWebResponse.StatusCode == HttpStatusCode.Unauthorized)
            {
                OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorAuthenticationToCas2Failure, base.OwaContext.SecondCasUri.ToString(), new object[]
                {
                    base.OwaContext.LocalHostName,
                    base.OwaContext.SecondCasUri.ToString()
                });
                OwaProxyException exception2 = new OwaProxyException("The proxy CAS failed to authenticate to the second CAS (it returned a 401)", LocalizedStrings.GetNonEncoded(-1102013722), outerException, false);
                this.asyncResult.CompleteRequest(false, exception2);
                return(true);
            }
            return(false);
        }
Esempio n. 2
0
        // Token: 0x06001201 RID: 4609 RVA: 0x0006D43C File Offset: 0x0006B63C
        private bool CheckAndHandleConnectionFailure(WebException webException, Exception outerException)
        {
            ExTraceGlobals.ProxyCallTracer.TraceDebug((long)this.GetHashCode(), "ProxyEventHandler.HandleConnectionFailure");
            if (outerException == null)
            {
                outerException = webException;
            }
            if (!ProxyEventHandler.IsConnectionFailure(webException))
            {
                return(false);
            }
            ExTraceGlobals.ProxyTracer.TraceDebug((long)this.GetHashCode(), "The proxy attempt failed, so we'll fail over to another CAS");
            this.attemptedProxyUriCount++;
            if (base.OwaContext.ProxyUriQueue.Count == 1 || this.attemptedProxyUriCount > base.OwaContext.ProxyUriQueue.Count)
            {
                OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorCASFailoverAllAttemptsFailed, base.OwaContext.SecondCasUri.ToString(), new object[]
                {
                    base.OwaContext.LocalHostName,
                    base.OwaContext.SecondCasUri.ToString(),
                    string.Format("webExceptionStatus={0}", webException.Status)
                });
                OwaProxyException exception = new OwaProxyException("None of the CAS servers are responding", LocalizedStrings.GetNonEncoded(-200732695), outerException, false);
                this.asyncResult.CompleteRequest(false, exception);
                return(true);
            }
            ProxyUri secondCasUri = base.OwaContext.SecondCasUri;

            this.GetNextFailoverCas();
            OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorCASFailoverTryNextOne, secondCasUri.ToString(), new object[]
            {
                base.OwaContext.LocalHostName,
                secondCasUri.ToString(),
                base.OwaContext.SecondCasUri.ToString(),
                string.Format("webExceptionStatus={0}", webException.Status)
            });
            bool result;

            try
            {
                this.SendProxyRequest();
                result = true;
            }
            catch (Exception exception2)
            {
                this.asyncResult.CompleteRequest(false, exception2);
                result = true;
            }
            return(result);
        }
Esempio n. 3
0
 // Token: 0x060011FF RID: 4607 RVA: 0x0006D3A4 File Offset: 0x0006B5A4
 private void HandleWebExceptionDefault(WebException webException, Exception outerException)
 {
     if (webException.Status == WebExceptionStatus.TrustFailure)
     {
         OwaDiagnostics.LogEvent(ClientsEventLogConstants.Tuple_ProxyErrorSslTrustFailure, base.OwaContext.SecondCasUri.ToString(), new object[]
         {
             base.OwaContext.LocalHostName,
             base.OwaContext.SecondCasUri.ToString()
         });
         OwaProxyException exception = new OwaProxyException("Error establishing SSL connection", LocalizedStrings.GetNonEncoded(-750997814), outerException, false);
         this.asyncResult.CompleteRequest(false, exception);
         return;
     }
     this.asyncResult.CompleteRequest(false, outerException);
 }