Skip to content

Commit

Permalink
don't attempt proxy access on .NET Core
Browse files Browse the repository at this point in the history
This feature is not supported on .NET Core.
This bug was introduced in connamara#524.
  • Loading branch information
gbirchmeier committed Jul 10, 2019
1 parent 4baeda3 commit 35d3601
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion QuickFIXn/Transport/StreamFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,17 @@ private static Socket CreateTunnelThruProxy(string destIP, int destPort)
Uri destUri = uriBuilder.Uri;
IWebProxy webProxy = WebRequest.GetSystemWebProxy();

if (webProxy.IsBypassed(destUri))
try
{
if (webProxy.IsBypassed(destUri))
return null;
}
catch (PlatformNotSupportedException)
{
// .NET Core doesn't support IWebProxy.IsBypassed
// (because .NET Core doesn't have access to Windows-specific services, of course)
return null;
}

Uri proxyUri = webProxy.GetProxy(destUri);
IPAddress[] proxyEntry = Dns.GetHostAddresses(proxyUri.Host);
Expand Down
1 change: 1 addition & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ What's New
* (minor) #521 - fix misspelled session reject reason (vpfau)
* (minor) #524 - add tunnel support; expand cert store search to include LocalMachine (nileshwagel/gbirchmeier)
* (minor) #531 - change encoding to iso-8859-1 (aka latin1) (amibar/gbirchmeier)
* (patch) #532 - bug in #524: don't attempt non-.NET-Core-supported functionality (gbirchmeier)

### v1.8.0:
* (patch) #402 - Multithreading fix to please NUnit 2.6.3 and above (arkadiuszwojcik)
Expand Down

0 comments on commit 35d3601

Please sign in to comment.