Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using this library on a machine with IIS Crypto set to Strict causes "An error occured while sending the request" #2171

Open
kimboslice99 opened this issue Feb 15, 2024 · 1 comment
Labels

Comments

@kimboslice99
Copy link

As the title says, if you use IIS Crypto and set the template to strict, the following error occurs, with no exception thrown

An error occured while sending the request

Expected behavior
I would expect an exception to be thrown if a suitable cipher is not found

Desktop (please complete the following information):

  • OS: Windows Server 2022
  • .NET version .NET Framework
  • Version 110.2.0

The relevant piece of code

           using (RestClient client = new RestClient("https://domain.tld/"))
            {
                var request = new RestRequest("path", Method.Get);
                try
                {
                    var restResponse = client.Execute(request);
                    if (restResponse.IsSuccessful)
                    {
                        // do stuff
                    }
                    else
                    {
                        Debug.WriteLine("response not successful " + restResponse.ErrorMessage + " " + restResponse.StatusCode);
                        return true;
                    }
                }
                catch (Exception e)
                {
                    Debug.WriteLine("exception " + e.Message);
                    return false;
                }
            }
@alexeyzimarev
Copy link
Member

The message An error occured while sending the request is not produced by RestSharp. RestSharp passes over the HttpClient exception as response.ErrorException. If HttpClient doesn't return a proper exception, there's nothing that RestSharp could do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants