History

GSF.ServiceProcess: In ClientHelper, fixed invalid authentication failures due to a short client-side timeout.

StephenCWills committed 8 years ago

Commit 276a58a1 parent 4a4c6ef6 files · +144 −129Browse files

Unified · Split

6 files
  1. Source/Libraries/GSF.Communication/Payload.cs +8 −4
  2. Source/Libraries/GSF.Communication/TcpClient.cs +14 −0
  3. Source/Libraries/GSF.Communication/TcpServer.cs +12 −17
  4. Source/Libraries/GSF.Communication/TlsClient.cs +28 −0
  5. Source/Libraries/GSF.Communication/TlsServer.cs +73 −94
  6. Source/Libraries/GSF.ServiceProcess/ClientHelper.cs +9 −14
Source/Libraries/GSF.Communication/Payload.cs+8−4
@@ -109,11 +109,15 @@ namespace GSF.Communication · 108 unmodified lines
109109 /// <returns>Length of the payload.</returns>
110110 public static int ExtractLength(byte[] buffer, int length, byte[] marker)
111111 {
112− // Check to see if buffer is at least as big as the payload header and has the payload marker
113− if (length >= (marker.Length + LengthSegment) && HasHeader(buffer, marker))
114− return BitConverter.ToInt32(buffer, marker.Length);
112+ // Check to see if buffer is at least as big as the payload header
113+ if (length < (marker.Length + LengthSegment))
114+ return -1;
115115
116− return -1;
116+ // Check to see if buffer has the payload marker
117+ if (!HasHeader(buffer, marker))
118+ return 0;
119+
120+ return BitConverter.ToInt32(buffer, marker.Length);
117121 }
118122 }
119123 }
Source/Libraries/GSF.Communication/TcpClient.cs+14−0
@@ -167,6 +167,7 @@ namespace GSF.Communication · 166 unmodified lines
167167 public int ConnectionAttempts;
168168
169169 public CancellationToken Token = new CancellationToken();
170+ public ICancellationToken TimeoutToken;
170171
171172 public void Dispose()
172173 {
@@ -744,6 +745,15 @@ namespace GSF.Communication · 571 unmodified lines
744745 // send and receive operations on the socket
745746 connectState.NetworkStream = new NetworkStream(connectState.Socket, false);
746747 connectState.NegotiateStream = new NegotiateStream(connectState.NetworkStream, true);
748+
749+ connectState.TimeoutToken = new Action(() =>
750+ {
751+ SocketException ex = new SocketException((int)SocketError.TimedOut);
752+ OnConnectionException(ex);
753+ TerminateConnection(connectState.Token);
754+ connectState.Dispose();
755+ }).DelayAndExecute(15000);
756+
747757 connectState.NegotiateStream.BeginAuthenticateAsClient(m_networkCredential ?? (NetworkCredential)CredentialCache.DefaultCredentials, string.Empty, ProcessIntegratedSecurityAuthentication, connectState);
748758 #endif
749759 }
@@ -875,6 +885,10 @@ namespace GSF.Communication · 125 unmodified lines
875885 // Get the connect state from the async result
876886 connectState = (ConnectState)asyncResult.AsyncState;
877887
888+ // Attempt to cancel the timeout operation
889+ if (!connectState.TimeoutToken.Cancel())
890+ return;
891+
878892 // Quit if this connection loop has been cancelled
879893 if (connectState.Token.Cancelled)
880894 return;
Source/Libraries/GSF.Communication/TcpServer.cs+12−17
@@ -803,6 +803,7 @@ namespace GSF.Communication · 802 unmodified lines
803803 TransportProvider<Socket> client = new TransportProvider<Socket>();
804804 SocketAsyncEventArgs receiveArgs = null;
805805 WindowsPrincipal clientPrincipal = null;
806+ IPEndPoint remoteEndPoint = null;
806807 TcpClientInfo clientInfo;
807808
808809 try
@@ -829,6 +830,7 @@ namespace GSF.Communication · 20 unmodified lines
829830 // Process the newly connected client.
830831 client.Provider = acceptArgs.AcceptSocket;
831832 client.Provider.ReceiveBufferSize = ReceiveBufferSize;
833+ remoteEndPoint = client.Provider.RemoteEndPoint as IPEndPoint;
832834
833835 // Set up SocketAsyncEventArgs for receive operations.
834836 receiveArgs = FastObjectFactory<SocketAsyncEventArgs>.CreateObjectFunction();
@@ -838,9 +840,7 @@ namespace GSF.Communication · 3 unmodified lines
838840 acceptArgs.AcceptSocket = null;
839841
840842 if (!m_tcpServer.AcceptAsync(acceptArgs))
841− {
842843 ThreadPool.QueueUserWorkItem(state => ProcessAccept(acceptArgs));
843− }
844844
845845 #if !MONO
846846 // Authenticate the connected client Windows credentials.
@@ -851,10 +851,15 @@ namespace GSF.Communication · 4 unmodified lines
851851
852852 try
853853 {
854− socketStream = new NetworkStream(client.Provider);
855− authenticationStream = new NegotiateStream(socketStream);
854+ socketStream = new NetworkStream(client.Provider, false);
855+ authenticationStream = new NegotiateStream(socketStream, true);
856+
857+ ICancellationToken timeoutToken = new Action(() => client.Provider.Dispose()).DelayAndExecute(15000);
856858 authenticationStream.AuthenticateAsServer();
857859
860+ if (!timeoutToken.Cancel())
861+ throw new SocketException((int)SocketError.TimedOut);
862+
858863 if (authenticationStream.RemoteIdentity is WindowsIdentity)
859864 clientPrincipal = new WindowsPrincipal((WindowsIdentity)authenticationStream.RemoteIdentity);
860865 }
@@ -940,22 +945,12 @@ namespace GSF.Communication · 79 unmodified lines
940945 catch (Exception ex)
941946 {
942947 // Notify of the exception.
943− if ((object)client.Provider != null && (object)client.Provider.RemoteEndPoint != null)
944− {
945− string clientAddress = ((IPEndPoint)client.Provider.RemoteEndPoint).Address.ToString();
946− string errorMessage = $"Unable to accept connection to client [{clientAddress}]: {ex.Message}";
947− OnClientConnectingException(new Exception(errorMessage, ex));
948− }
949− else
950− {
951− string errorMessage = $"Unable to accept connection to client [unknown]: {ex.Message}";
952− OnClientConnectingException(new Exception(errorMessage, ex));
953− }
948+ string clientAddress = remoteEndPoint?.Address.ToString() ?? "UNKNOWN";
949+ string errorMessage = $"Unable to accept connection to client [{clientAddress}]: {ex.Message}";
950+ OnClientConnectingException(new Exception(errorMessage, ex));
954951
955952 if ((object)receiveArgs != null)
956− {
957953 TerminateConnection(client, receiveArgs, false);
958− }
959954 }
960955 }
961956
Source/Libraries/GSF.Communication/TlsClient.cs+28−0
@@ -64,6 +64,7 @@ namespace GSF.Communication · 63 unmodified lines
6464 public int ConnectionAttempts;
6565
6666 public CancellationToken Token = new CancellationToken();
67+ public ICancellationToken TimeoutToken;
6768
6869 public void Dispose()
6970 {
@@ -909,7 +910,17 @@ namespace GSF.Communication · 839 unmodified lines
909910 endpoint = Regex.Match(m_connectData["server"], Transport.EndpointFormatRegex);
910911
911912 if (!connectState.Token.Cancelled)
913+ {
914+ connectState.TimeoutToken = new Action(() =>
915+ {
916+ SocketException ex = new SocketException((int)SocketError.TimedOut);
917+ OnConnectionException(ex);
918+ TerminateConnection(connectState.Token);
919+ connectState.Dispose();
920+ }).DelayAndExecute(15000);
921+
912922 connectState.SslStream.BeginAuthenticateAsClient(endpoint.Groups["host"].Value, m_clientCertificates, m_enabledSslProtocols, m_checkCertificateRevocation, ProcessTlsAuthentication, connectState);
923+ }
913924 }
914925 catch (SocketException ex)
915926 {
@@ -968,6 +979,10 @@ namespace GSF.Communication · 52 unmodified lines
968979 // Get the connect state from the async result
969980 connectState = (ConnectState)asyncResult.AsyncState;
970981
982+ // Attempt to cancel the timeout operation
983+ if (!connectState.TimeoutToken.Cancel())
984+ return;
985+
971986 // Quit if this connection loop has been cancelled
972987 if (connectState.Token.Cancelled)
973988 return;
@@ -995,6 +1010,15 @@ namespace GSF.Communication · 21 unmodified lines
9951010
9961011 // Create the NegotiateStream to begin authentication of the user's Windows credentials
9971012 connectState.NegotiateStream = new NegotiateStream(connectState.SslStream, true);
1013+
1014+ connectState.TimeoutToken = new Action(() =>
1015+ {
1016+ SocketException ex = new SocketException((int)SocketError.TimedOut);
1017+ OnConnectionException(ex);
1018+ TerminateConnection(connectState.Token);
1019+ connectState.Dispose();
1020+ }).DelayAndExecute(15000);
1021+
9981022 connectState.NegotiateStream.BeginAuthenticateAsClient(m_networkCredential ?? (NetworkCredential)CredentialCache.DefaultCredentials, string.Empty, ProcessIntegratedSecurityAuthentication, connectState);
9991023 #endif
10001024 }
@@ -1112,6 +1136,10 @@ namespace GSF.Communication · 111 unmodified lines
11121136 // Get the connect state from the async result
11131137 connectState = (ConnectState)asyncResult.AsyncState;
11141138
1139+ // Attempt to cancel the timeout operation
1140+ if (!connectState.TimeoutToken.Cancel())
1141+ return;
1142+
11151143 // Quit if this connection loop has been cancelled
11161144 if (connectState.Token.Cancelled)
11171145 return;
Source/Libraries/GSF.Communication/TlsServer.cs+73−94
@@ -76,6 +76,11 @@ namespace GSF.Communication · 75 unmodified lines
7676 /// </summary>
7777 public SslStream SslStream;
7878
79+ /// <summary>
80+ /// The end point of the remote client connecting to this server.
81+ /// </summary>
82+ public IPEndPoint RemoteEndPoint;
83+
7984 /// <summary>
8085 /// Performs application-defined tasks associated with
8186 /// freeing, releasing, or resetting unmanaged resources.
@@ -93,11 +98,14 @@ namespace GSF.Communication · 11 unmodified lines
9398 private class TlsClientInfo
9499 {
95100 public TransportProvider<TlsSocket> Client;
101+ public ICancellationToken TimeoutToken;
102+
103+ public int Sending;
96104 public object SendLock;
97105 public ConcurrentQueue<TlsServerPayload> SendQueue;
98106 public ShortSynchronizedOperation DumpPayloadsOperation;
99− public int Sending;
100107
108+ public NegotiateStream NegotiateStream;
101109 public WindowsPrincipal ClientPrincipal;
102110 }
103111
@@ -995,7 +1003,6 @@ namespace GSF.Communication · 891 unmodified lines
9951003 private void ProcessAccept(SocketAsyncEventArgs acceptArgs)
9961004 {
9971005 TransportProvider<TlsSocket> client = new TransportProvider<TlsSocket>();
998− IPEndPoint remoteEndPoint = null;
9991006 NetworkStream netStream;
10001007
10011008 try
@@ -1025,9 +1032,6 @@ namespace GSF.Communication · 23 unmodified lines
10251032
10261033 try
10271034 {
1028− // Get the remote end point in case we need to display useful error messages
1029− remoteEndPoint = acceptArgs.AcceptSocket.RemoteEndPoint as IPEndPoint;
1030−
10311035 if (MaxClientConnections != -1 && ClientIDs.Length >= MaxClientConnections)
10321036 {
10331037 // Reject client connection since limit has been reached.
@@ -1042,11 +1046,43 @@ namespace GSF.Communication · 8 unmodified lines
10421046 client.Provider = new TlsSocket
10431047 {
10441048 Socket = acceptArgs.AcceptSocket,
1045− SslStream = new SslStream(netStream, false, m_remoteCertificateValidationCallback ?? CertificateChecker.ValidateRemoteCertificate, m_localCertificateSelectionCallback)
1049+ SslStream = new SslStream(netStream, false, m_remoteCertificateValidationCallback ?? CertificateChecker.ValidateRemoteCertificate, m_localCertificateSelectionCallback),
1050+ RemoteEndPoint = acceptArgs.AcceptSocket.RemoteEndPoint as IPEndPoint
10461051 };
10471052
10481053 client.Provider.Socket.ReceiveBufferSize = ReceiveBufferSize;
1049− client.Provider.SslStream.BeginAuthenticateAsServer(m_certificate, m_requireClientCertificate, m_enabledSslProtocols, m_checkCertificateRevocation, ProcessTlsAuthentication, client);
1054+
1055+ TlsClientInfo clientInfo = new TlsClientInfo
1056+ {
1057+ Client = client,
1058+ SendLock = new object(),
1059+ SendQueue = new ConcurrentQueue<TlsServerPayload>()
1060+ };
1061+
1062+ // Create operation to dump send queue payloads when the queue grows too large.
1063+ clientInfo.DumpPayloadsOperation = new ShortSynchronizedOperation(() =>
1064+ {
1065+ TlsServerPayload payload;
1066+
1067+ // Check to see if the client has reached the maximum send queue size.
1068+ if (m_maxSendQueueSize > 0 && clientInfo.SendQueue.Count >= m_maxSendQueueSize)
1069+ {
1070+ for (int i = 0; i < m_maxSendQueueSize; i++)
1071+ {
1072+ if (clientInfo.SendQueue.TryDequeue(out payload))
1073+ {
1074+ payload.WaitHandle.Set();
1075+ payload.WaitHandle.Dispose();
1076+ payload.WaitHandle = null;
1077+ }
1078+ }
1079+
1080+ throw new InvalidOperationException($"Client {clientInfo.Client.ID} connected to TCP server reached maximum send queue size. {m_maxSendQueueSize} payloads dumped from the queue.");
1081+ }
1082+ }, ex => OnSendClientDataException(clientInfo.Client.ID, ex));
1083+
1084+ clientInfo.TimeoutToken = new Action(() => client.Provider.Socket.Dispose()).DelayAndExecute(15000);
1085+ client.Provider.SslStream.BeginAuthenticateAsServer(m_certificate, m_requireClientCertificate, m_enabledSslProtocols, m_checkCertificateRevocation, ProcessTlsAuthentication, clientInfo);
10501086 }
10511087 }
10521088 finally
@@ -1067,13 +1103,10 @@ namespace GSF.Communication · 14 unmodified lines
10671103 catch (Exception ex)
10681104 {
10691105 // Notify of the exception.
1070− if ((object)remoteEndPoint != null)
1071− {
1072− string clientAddress = remoteEndPoint.Address.ToString();
1073− string errorMessage = $"Unable to accept connection to client [{clientAddress}]: {ex.Message}";
1074− OnClientConnectingException(new Exception(errorMessage, ex));
1075− }
1076−
1106+ IPEndPoint remoteEndPoint = client.Provider?.RemoteEndPoint;
1107+ string clientAddress = remoteEndPoint?.Address.ToString() ?? "UNKNOWN";
1108+ string errorMessage = $"Unable to accept connection to client [{clientAddress}]: {ex.Message}";
1109+ OnClientConnectingException(new Exception(errorMessage, ex));
10771110 TerminateConnection(client, false);
10781111 }
10791112 }
@@ -1083,12 +1116,15 @@ namespace GSF.Communication · 3 unmodified lines
10831116 /// </summary>
10841117 private void ProcessTlsAuthentication(IAsyncResult asyncResult)
10851118 {
1086− TransportProvider<TlsSocket> client = (TransportProvider<TlsSocket>)asyncResult.AsyncState;
1087− IPEndPoint remoteEndPoint = client.Provider.Socket.RemoteEndPoint as IPEndPoint;
1119+ TlsClientInfo clientInfo = (TlsClientInfo)asyncResult.AsyncState;
1120+ TransportProvider<TlsSocket> client = clientInfo.Client;
10881121 SslStream stream = client.Provider.SslStream;
10891122
10901123 try
10911124 {
1125+ if (!clientInfo.TimeoutToken.Cancel())
1126+ throw new SocketException((int)SocketError.TimedOut);
1127+
10921128 stream.EndAuthenticateAsServer(asyncResult);
10931129
10941130 if (EnabledSslProtocols != SslProtocols.None)
@@ -1103,41 +1139,13 @@ namespace GSF.Communication · 8 unmodified lines
11031139 if (m_integratedSecurity)
11041140 {
11051141 #if !MONO
1106− NegotiateStream negotiateStream = new NegotiateStream(stream, true);
1107− negotiateStream.BeginAuthenticateAsServer(ProcessIntegratedSecurityAuthentication, Tuple.Create(client, negotiateStream));
1142+ clientInfo.NegotiateStream = new NegotiateStream(stream, true);
1143+ clientInfo.TimeoutToken = new Action(() => client.Provider.Socket.Dispose()).DelayAndExecute(15000);
1144+ clientInfo.NegotiateStream.BeginAuthenticateAsServer(ProcessIntegratedSecurityAuthentication, clientInfo);
11081145 #endif
11091146 }
11101147 else
11111148 {
1112− TlsClientInfo clientInfo = new TlsClientInfo
1113− {
1114− Client = client,
1115− SendLock = new object(),
1116− SendQueue = new ConcurrentQueue<TlsServerPayload>()
1117− };
1118−
1119− // Create operation to dump send queue payloads when the queue grows too large.
1120− clientInfo.DumpPayloadsOperation = new ShortSynchronizedOperation(() =>
1121− {
1122− TlsServerPayload payload;
1123−
1124− // Check to see if the client has reached the maximum send queue size.
1125− if (m_maxSendQueueSize > 0 && clientInfo.SendQueue.Count >= m_maxSendQueueSize)
1126− {
1127− for (int i = 0; i < m_maxSendQueueSize; i++)
1128− {
1129− if (clientInfo.SendQueue.TryDequeue(out payload))
1130− {
1131− payload.WaitHandle.Set();
1132− payload.WaitHandle.Dispose();
1133− payload.WaitHandle = null;
1134− }
1135− }
1136−
1137− throw new InvalidOperationException($"Client {clientInfo.Client.ID} connected to TCP server reached maximum send queue size. {m_maxSendQueueSize} payloads dumped from the queue.");
1138− }
1139− }, ex => OnSendClientDataException(clientInfo.Client.ID, ex));
1140−
11411149 // We can proceed further with receiving data from the client.
11421150 m_clientInfoLookup.TryAdd(client.ID, clientInfo);
11431151
@@ -1148,12 +1156,10 @@ namespace GSF.Communication · 4 unmodified lines
11481156 catch (Exception ex)
11491157 {
11501158 // Notify of the exception.
1151− if ((object)remoteEndPoint != null)
1152− {
1153− string clientAddress = remoteEndPoint.Address.ToString();
1154− string errorMessage = $"Unable to authenticate connection to client [{clientAddress}]: {CertificateChecker.ReasonForFailure ?? ex.Message}";
1155− OnClientConnectingException(new Exception(errorMessage, ex));
1156− }
1159+ IPEndPoint remoteEndPoint = client.Provider.RemoteEndPoint;
1160+ string clientAddress = remoteEndPoint.Address.ToString();
1161+ string errorMessage = $"Unable to authenticate connection to client [{clientAddress}]: {CertificateChecker.ReasonForFailure ?? ex.Message}";
1162+ OnClientConnectingException(new Exception(errorMessage, ex));
11571163 TerminateConnection(client, false);
11581164 }
11591165 }
@@ -1161,20 +1167,26 @@ namespace GSF.Communication · 1 unmodified line
11611167 #if !MONO
11621168 private void ProcessIntegratedSecurityAuthentication(IAsyncResult asyncResult)
11631169 {
1164− Tuple<TransportProvider<TlsSocket>, NegotiateStream> state = (Tuple<TransportProvider<TlsSocket>, NegotiateStream>)asyncResult.AsyncState;
1165− TransportProvider<TlsSocket> client = state.Item1;
1166− IPEndPoint remoteEndPoint = client.Provider.Socket.RemoteEndPoint as IPEndPoint;
1167− NegotiateStream negotiateStream = state.Item2;
1168− WindowsPrincipal clientPrincipal = null;
1170+ TlsClientInfo clientInfo = (TlsClientInfo)asyncResult.AsyncState;
1171+ TransportProvider<TlsSocket> client = clientInfo.Client;
1172+ NegotiateStream negotiateStream = clientInfo.NegotiateStream;
1173+ IPEndPoint remoteEndPoint = client.Provider.RemoteEndPoint;
1174+ WindowsPrincipal clientPrincipal;
11691175
11701176 try
11711177 {
1178+ if (!clientInfo.TimeoutToken.Cancel())
1179+ throw new SocketException((int)SocketError.TimedOut);
1180+
11721181 try
11731182 {
11741183 negotiateStream.EndAuthenticateAsServer(asyncResult);
11751184
11761185 if (negotiateStream.RemoteIdentity is WindowsIdentity)
1186+ {
11771187 clientPrincipal = new WindowsPrincipal((WindowsIdentity)negotiateStream.RemoteIdentity);
1188+ clientInfo.ClientPrincipal = clientPrincipal;
1189+ }
11781190 }
11791191 catch (InvalidCredentialException)
11801192 {
@@ -1182,36 +1194,6 @@ namespace GSF.Communication · 1 unmodified line
11821194 throw;
11831195 }
11841196
1185− TlsClientInfo clientInfo = new TlsClientInfo
1186− {
1187− Client = client,
1188− SendLock = new object(),
1189− SendQueue = new ConcurrentQueue<TlsServerPayload>(),
1190− ClientPrincipal = clientPrincipal
1191− };
1192−
1193− // Create operation to dump send queue payloads when the queue grows too large.
1194− clientInfo.DumpPayloadsOperation = new ShortSynchronizedOperation(() =>
1195− {
1196− TlsServerPayload payload;
1197−
1198− // Check to see if the client has reached the maximum send queue size.
1199− if (m_maxSendQueueSize > 0 && clientInfo.SendQueue.Count >= m_maxSendQueueSize)
1200− {
1201− for (int i = 0; i < m_maxSendQueueSize; i++)
1202− {
1203− if (clientInfo.SendQueue.TryDequeue(out payload))
1204− {
1205− payload.WaitHandle.Set();
1206− payload.WaitHandle.Dispose();
1207− payload.WaitHandle = null;
1208− }
1209− }
1210−
1211− throw new InvalidOperationException($"Client {clientInfo.Client.ID} connected to TCP server reached maximum send queue size. {m_maxSendQueueSize} payloads dumped from the queue.");
1212− }
1213− }, ex => OnSendClientDataException(clientInfo.Client.ID, ex));
1214−
12151197 // We can proceed further with receiving data from the client.
12161198 m_clientInfoLookup.TryAdd(client.ID, clientInfo);
12171199
@@ -1221,12 +1203,9 @@ namespace GSF.Communication · 3 unmodified lines
12211203 catch (Exception ex)
12221204 {
12231205 // Notify of the exception.
1224− if ((object)remoteEndPoint != null)
1225− {
1226− string clientAddress = remoteEndPoint.Address.ToString();
1227− string errorMessage = $"Unable to authenticate connection to client [{clientAddress}]: {ex.Message}";
1228− OnClientConnectingException(new Exception(errorMessage, ex));
1229− }
1206+ string clientAddress = remoteEndPoint.Address.ToString();
1207+ string errorMessage = $"Unable to authenticate connection to client [{clientAddress}]: {ex.Message}";
1208+ OnClientConnectingException(new Exception(errorMessage, ex));
12301209 TerminateConnection(client, false);
12311210 }
12321211 finally
Source/Libraries/GSF.ServiceProcess/ClientHelper.cs+9−14
@@ -540,18 +540,17 @@ namespace GSF.ServiceProcess · 539 unmodified lines
540540 /// </summary>
541541 public void Connect()
542542 {
543− if ((object)m_remotingClient == null)
543+ ClientBase remotingClient = m_remotingClient;
544+
545+ if ((object)remotingClient == null)
544546 throw new InvalidOperationException("RemotingClient property of ClientHelper component is not set");
545547
546548 m_authenticationComplete = false;
547549
548550 // Wait for connection.
549− m_remotingClient.Connect();
550−
551− const int MaxWaitPeriods = 50; // Will wait a maximum of 5 seconds before assuming failure
552− int attempts = 0;
551+ remotingClient.Connect();
553552
554− while (!m_authenticationComplete && m_remotingClient.Enabled && attempts++ < MaxWaitPeriods)
553+ while (remotingClient.Enabled && !m_authenticationComplete)
555554 {
556555 // Wait for authentication.
557556 Thread.Sleep(100);
@@ -561,14 +560,10 @@ namespace GSF.ServiceProcess · 3 unmodified lines
561560 return;
562561 }
563562
564− // It is possible that local domain account will not be accepted and/or recognized by remote
565− // server when attempting to use integrated security - in these cases the sent client info
566− // message can be rejected so the ServiceHelper will neither respond with success or failure.
567− // We treat this as an authentication failure so that credentials can be requested.
568− if (attempts >= MaxWaitPeriods)
569− OnAuthenticationFailure();
563+ if (!m_authenticationComplete)
564+ UpdateStatus(UpdateType.Alarm, "Connection was terminated before completing authentication.\r\n\r\n");
570565
571− if (m_remotingClient.Enabled)
566+ if (remotingClient.Enabled)
572567 m_attemptReconnection = true;
573568 }
574569
@@ -777,7 +772,6 @@ namespace GSF.ServiceProcess · 202 unmodified lines
777772 status.Append(m_remotingClient.Status);
778773 status.AppendLine();
779774 UpdateStatus(UpdateType.Information, "{0}", status.ToString());
780− SendRequest(StatusMessageFilter);
781775 }
782776
783777 private void RemotingClient_ConnectionException(object sender, EventArgs<Exception> e)
@@ -848,6 +842,7 @@ namespace GSF.ServiceProcess · 64 unmodified lines
848842 UpdateStatus(UpdateType.Alarm, "{0}", response.Message);
849843 break;
850844 case "AUTHENTICATIONSUCCESS":
845+ SendRequest(StatusMessageFilter);
851846 OnAuthenticationSuccess();
852847 break;
853848 case "AUTHENTICATIONFAILURE":

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t