@@ -173,7 +173,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, Can
173173
174174 // https://tools.ietf.org/html/rfc7230#section-2.7.1
175175 // 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 ) ;
177177
178178 // https://tools.ietf.org/html/rfc7230#section-2.6
179179 // Intermediaries that process HTTP messages (i.e., all intermediaries
@@ -197,25 +197,7 @@ public async Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, Can
197197 Stream stream = TorSocks5Client . TcpClient . GetStream ( ) ;
198198 if ( request . RequestUri . Scheme == "https" )
199199 {
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 ) ;
219201
220202 await sslStream
221203 . AuthenticateAsClientAsync (
0 commit comments