Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

584
Visualizações
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
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda