Reputation: 55
We are running small .net application in azure webapps which collects data and trigger .ps1 file to send email via powershell send-mailmessage
.Netversion : 4.8 platform = 32bit HTTP version : 1.1 Minimum TLS Version : 1.2 HTTPS Only: Off
Now the issue is mails are sending with TLS1.0, as you are aware TLS 1.0 not support in future we wanted to enforce it to TLS 1.2, on webapp TLS settings enabled TLS as 1.2 but still taking it as 1.0 only
where as while sending same from local powershell its taking TLS2.0, please help me on how to send to emails with minimum TLS 1.2
Upvotes: 0
Views: 102
Reputation: 4870
You can force Powershell to use TLS 1.2 by adding below command in your PowerShell profile:
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
It’s probably better to include the command in any script which uses the Send-MailMessage
cmdlet.
The issue has been known for a while and other email platforms also insist on TLS 1.2 connection and use the same solution for PowerShell (here’s an example).
Do check out Force PowerShell to Use TLS 1.2.
Upvotes: 0