0

I've got an odd variation of the "The request was aborted: Could not create SSL/TLS secure channel". Using .NET Web Forms, I have a HttpWebRequest the yields the error, but only after the initial compile. If I simply refresh the webpage, it works fine and does what it needs to. I'd like to find a solution to get rid of the initial error altogether.

I've tried a number of different solutions to prevent the initial error from happening, but have not found any success.

I'm curious if anyone else has seen the error happen in this way? If so, have you found a solution?

6
  • have you tried to use another framework. Commented Jan 25, 2024 at 18:50
  • Yes, was originally on 4.0, then 4.5.2, now running on 4.7. To my understanding, this shouldn't be an issue with 4.7 (and it's not, for 99% of the requests), it's just an issue after recompiling or when the AppPool recycles. Commented Jan 25, 2024 at 18:56
  • Additionally, I used IIS Crypto to get rid of old protocols and make sure all current protocols are enabled. Commented Jan 25, 2024 at 19:06
  • try 4.8 and 7,.0 or 8.9, but i thing that your server has only old vulnerable ssl/tls version, so you should first look at the webseerver which protcolls he supports, if you can not upgrade the server, you need to downgrade the framework Commented Jan 25, 2024 at 19:28
  • This is a .NET web application, so I don't believe that I can go beyond 4.8. I'll give that a shot and see what happens. Commented Jan 25, 2024 at 19:35

1 Answer 1

0

As mentioned in the title, I had a odd situation where I'd get this error "The request was aborted: Could not create SSL/TLS secure channel", but only after being recompiled or after the AppPool would recycle. After the first/initial error, all subsequent requests would work fine, until the next recompile or AppPool recyle.

Going back to the framework suggestions, I reviewed the targetFramework which was 4.7. I reviewed the web.config and noticed that I did not have targetFramework set inside the httpRuntime tag (in fact, I didn't even have the httpRuntime tag. Adding the following solved the issue - no more errors on the initial load:

<system.web> <httpRuntime targetFramework="4.7" /> ... 

Note: I did have targetFramework set within my tag, but adding the <httpRuntime/> tag with targetFramework="4.7" resolved the problem.

This change did cause another issue with UnobtrusiveValidation mode, but that was easily solved by following this suggestion: WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for jquery

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.