@@ -24,18 +24,16 @@ class ServiceClient<TInterface> : IServiceClient, IConnectionKey where TInterfac
24
24
private Server _server ;
25
25
private ClientConnection _clientConnection ;
26
26
27
- internal ServiceClient ( ISerializer serializer , TimeSpan requestTimeout , ILogger logger , ConnectionFactory connectionFactory , string sslServer = null , BeforeCallHandler beforeCall = null , EndpointSettings serviceEndpoint = null )
27
+ internal ServiceClient ( ISerializer serializer , TimeSpan requestTimeout , ILogger logger , ConnectionFactory connectionFactory , BeforeCallHandler beforeCall = null , EndpointSettings serviceEndpoint = null )
28
28
{
29
29
_serializer = serializer ;
30
30
_requestTimeout = requestTimeout ;
31
31
_logger = logger ;
32
32
_connectionFactory = connectionFactory ;
33
- SslServer = sslServer ;
34
33
_beforeCall = beforeCall ;
35
34
_serviceEndpoint = serviceEndpoint ;
36
35
}
37
36
protected int HashCode { get ; init ; }
38
- public string SslServer { get ; init ; }
39
37
public virtual string Name => _connection ? . Name ;
40
38
private bool LogEnabled => _logger . Enabled ( ) ;
41
39
Connection IServiceClient . Connection => _connection ;
@@ -190,9 +188,8 @@ private async Task<bool> Connect(CancellationToken cancellationToken)
190
188
{
191
189
clientConnection . Dispose ( ) ;
192
190
throw ;
193
- }
194
- var stream = SslServer == null ? network : await AuthenticateAsClient ( network ) ;
195
- OnNewConnection ( new ( stream , _serializer , _logger , Name ) ) ;
191
+ }
192
+ OnNewConnection ( new ( network , _serializer , _logger , Name ) ) ;
196
193
if ( LogEnabled )
197
194
{
198
195
Log ( $ "CreateConnection { Name } .") ;
@@ -204,21 +201,6 @@ private async Task<bool> Connect(CancellationToken cancellationToken)
204
201
clientConnection . Release ( ) ;
205
202
}
206
203
return true ;
207
- async Task < Stream > AuthenticateAsClient ( Stream network )
208
- {
209
- var sslStream = new SslStream ( network ) ;
210
- try
211
- {
212
- await sslStream . AuthenticateAsClientAsync ( SslServer ) ;
213
- }
214
- catch
215
- {
216
- sslStream . Dispose ( ) ;
217
- throw ;
218
- }
219
- Debug . Assert ( sslStream . IsEncrypted && sslStream . IsSigned ) ;
220
- return sslStream ;
221
- }
222
204
}
223
205
224
206
private void ReuseClientConnection ( ClientConnection clientConnection )
@@ -276,7 +258,7 @@ protected virtual void Dispose(bool disposing)
276
258
277
259
public override string ToString ( ) => Name ;
278
260
279
- public virtual bool Equals ( IConnectionKey other ) => SslServer == other . SslServer ;
261
+ public virtual bool Equals ( IConnectionKey other ) => true ;
280
262
281
263
public virtual ClientConnection CreateClientConnection ( ) => throw new NotImplementedException ( ) ;
282
264
}
0 commit comments