@@ -173,7 +173,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, Can
173
173
174
174
// https://tools.ietf.org/html/rfc7230#section-2.7.1
175
175
// A sender MUST NOT generate an "http" URI with an empty host identifier.
176
- var host = Guard . NotNullOrEmptyOrWhitespace ( $ "{ nameof ( request ) } .{ nameof ( request . RequestUri ) } .{ nameof ( request . RequestUri . DnsSafeHost ) } ", request . RequestUri . DnsSafeHost , trim : true ) ;
176
+ string host = Guard . NotNullOrEmptyOrWhitespace ( $ "{ nameof ( request ) } .{ nameof ( request . RequestUri ) } .{ nameof ( request . RequestUri . DnsSafeHost ) } ", request . RequestUri . DnsSafeHost , trim : true ) ;
177
177
178
178
// https://tools.ietf.org/html/rfc7230#section-2.6
179
179
// Intermediaries that process HTTP messages (i.e., all intermediaries
@@ -197,25 +197,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, Can
197
197
Stream stream = TorSocks5Client . TcpClient . GetStream ( ) ;
198
198
if ( request . RequestUri . Scheme == "https" )
199
199
{
200
- SslStream sslStream ;
201
- // On Linux and OSX ignore certificate, because of a .NET Core bug
202
- // This is a security vulnerability, has to be fixed as soon as the bug get fixed
203
- // Details:
204
- // https://github.com/dotnet/corefx/issues/21761
205
- // https://github.com/nopara73/DotNetTor/issues/4
206
- if ( RuntimeInformation . IsOSPlatform ( OSPlatform . Windows ) )
207
- {
208
- sslStream = new SslStream (
209
- stream ,
210
- leaveInnerStreamOpen : true ) ;
211
- }
212
- else
213
- {
214
- sslStream = new SslStream (
215
- stream ,
216
- leaveInnerStreamOpen : true ,
217
- userCertificateValidationCallback : ( a , b , c , d ) => true ) ;
218
- }
200
+ SslStream sslStream = new SslStream ( stream , leaveInnerStreamOpen : true ) ;
219
201
220
202
await sslStream
221
203
. AuthenticateAsClientAsync (
0 commit comments