From befbf8539fa7d894dbaab8e13af4a3241d0e5709 Mon Sep 17 00:00:00 2001 From: SebastianGrief Date: Mon, 19 Sep 2022 14:50:13 +0200 Subject: [PATCH] Only add proxy settings to handler if supported --- src/RestSharp/RestClient.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/RestSharp/RestClient.cs b/src/RestSharp/RestClient.cs index 4df35a896..10479fdec 100644 --- a/src/RestSharp/RestClient.cs +++ b/src/RestSharp/RestClient.cs @@ -139,7 +139,11 @@ void ConfigureHttpMessageHandler(HttpClientHandler handler) { handler.AutomaticDecompression = Options.AutomaticDecompression; handler.PreAuthenticate = Options.PreAuthenticate; handler.AllowAutoRedirect = Options.FollowRedirects; - handler.Proxy = Options.Proxy; + + if (handler.SupportsProxy) + { + handler.Proxy = Options.Proxy; + } if (Options.RemoteCertificateValidationCallback != null) handler.ServerCertificateCustomValidationCallback =