0

I am not sure if there is a way to add TLS 1.2 or TLS 1.1 in ` in web.config file.

In code i can add it as

 System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

I am not sure how we can add it in Web.config file so that it can be used by mailSettings

<mailSettings>  
      <smtp from="ben@contoso.com">  
        <network  
          host="outlook.office365.com"  
          port="587"  
           enableSsl="true"
          userName="email@domain.com"  
          password="somepassword"
        />  
      </smtp>  
    </mailSettings>  

I need this to work in web.config file as hosting provider has disabled TLS 1.0 and now whenever we are trying to submit any form we get error related to SSL which is due to host doesnt support TLS1.0 .. so i made changes in code for some forms as

 System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 | SecurityProtocolType.Tls11 | SecurityProtocolType.Tls;

but password reset function which uses default mailsetting from web.config are still giving errors related to SSL as i am not sure how i can force TLS 1.2 in web.config

Learning
  • 19,469
  • 39
  • 180
  • 373
  • 1
    Look if this link can help you: https://kevinchalet.com/2019/04/11/forcing-an-old-net-application-to-support-tls-1-2-without-recompiling-it/ – Wolfgang Amadeus Oct 21 '21 at 02:50

0 Answers0