LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

SMTP problems because TLS

hello

 

i have a vi that send a email image smtp1

 

since the first days of this year i've been having able to send email

 

this is the error i received 

 

"error nº 1172

Invoke Node Error calling method System.Net.Mail.SmtpClient.Send, (System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
Inner Exception: System.Net.Mail.SmtpException: Failure sending mail.
Inner Exception: System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.) <append><b>System.IO.IOException</b> in email_smtp.vi"

 

i try another code smtp 2, i don't have any error but i don't received the email

 

i look in forums for the problem, and seems is related with TLS version

 

how could i resolve this in labview 2013

 

https://stackoverflow.com/questions/28362132/office-365-smtp-starts-firing-net-io-connectionclosed

Download All
0 Kudos
Message 1 of 5
(2,864 Views)

If you are trying to fix "TTL", then you are "fixing the wrong problem".  The problem is (as the Stack Overflow article explains) with the Transport Layer Security feature, which needs to be updated from Version 1.1 to 1.2.  Search the Web for TLS 1.2 and you should find an explanation.

 

Bob Schor

0 Kudos
Message 2 of 5
(2,857 Views)

@Bob thank very much

 

my problem is TLS and not TTL

 

i already correct the post, and i'm looking your solution

0 Kudos
Message 3 of 5
(2,849 Views)

The last entry in stack overflow about the .Net solution is quite clear.

 

Recently, we started rejecting a percentage of connections to smtp.office365.com that uses TLS1.0/1.1 for SMTP AUTH (complete disablement will start early 2022).

I can't help you with the .Net part. You have to make sure that the SmtpClient is configured properly to use TLS 1.2 explicitly. How that is done is always a difficult thing as that cryptography stuff seems to always be designed to make it hard to do anything. Currently you only configure the actual SmtpClient part that deals with your emails but you have to somehow tell him also what security transport layer provider to use.

 

As to the older LabVIEW versions SMTP client to force it to use TLS 1.2 I'm afraid that that is not going to work. LabVIEW 2013 uses internally a fairly old version of libcurl and OpenSSL that had TLS 1.0. and 1.1 not disabled and TLS 1.2 only as optional feature. There might be a possibility to change something by using an environment variable since OpenSSL can be influenced with environment variables but this is all so well hidden behind the neat VI library interface that it is really hard to figure that out without having direct access to the code behind it. And NI was always very tight lipped about these things, so it would seem that this is a dead end.

 

Newer LabVIEW versions use much newer versions of OpenSSL and that MIGHT also influence how the SMTP Client library operates but I can't say for sure.

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 4 of 5
(2,772 Views)

Problem solve

 

i create a VI that create a vbs file than i can execute 

 

my email server is office365

0 Kudos
Message 5 of 5
(2,649 Views)