Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

583
Views
Supporting different version of TLS in .Net

I support a legacy on-premise .Net 4.0 WinForms application. The application uses System.Net.Mail.SmtpClient to send emails via our customers' own SMTP servers. Recently, we've had issues with Office 365 mandating TLS 1.2. Having read that as long as .Net 4.5 is installed, .Net 4.0 applications can utilise TLS 1.2, I added this line:

System.Net.ServicePointManager.SecurityProtocol = (SecurityProtocolType)3072;   // 3072 = TLS 1.2

This solved the issue of connecting to Office 365, but introduced issues making non-SMTP connections to other older 3rd party applications that do not support TLS 1.2. I therefore changed the approach to add TLS 1.2 to the list of allowable protocols rather than set it as the mandated protocol (as outlined in this question and this question), and also added TLS 1.3 at the same time:

System.Net.ServicePointManager.SecurityProtocol |=
    (SecurityProtocolType)3072 |    // 3072 = TLS 1.2
    (SecurityProtocolType)12288;    // 12288 = TLS 1.3

This resolved both issues for some clients and works in our test environment with our own Office 365 account. However, some of our clients have reported issues connecting to Office 365 again. Revert to mandating TLS 1.2 again resolves the SMTP issue, but reintroduced the other problem.

Is it possible to specify the security protocol for a specific connection rather than take this global approach?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!