I'm not sure where to post this as it's not an issue with Excel-DNA per-se
although I think many others will be interested in the topic.
The website whose xml-api I am using has recently switched to tls1.2
only*
Due
to this, my Excel-DNA (1.1.1) addin got a SSL/TLS secure channel exception.
(I'm using Microsoft Excel for Microsoft 365 MSO (Version 2112 Build
16.0.14729.20254) 64-bit)
Upgrading Excel-DNA to 1.5.1 had the effect of making the connection fail
silently instead of raising an exception(!).
I was stumped for a while, because when I ran my code in f# interactive I
didn't have a problem connecting.
(Yes, it's an f# addin, but turns out that this time f# wasn't the problem).
Then I checked the runtime being used, 5.0.11 for fsi and 4.8.4420.0 in the addin under Excel.
So I compiled a stand alone 4.8.4420.0 test, expecting it to fail, but it worked....
After some digging online I was led to the solution which worked:
"Enabling
TLS1.2 for dotnet" by adding the following two registry keys and
rebooting.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\v4.0.30319]
"SchUseStrongCrypto"=dword:00000001
The whole problem/solution can be reproduced with Excel alone by:
- entering the formula =WEBSERVICE("url of tls2 only website")
- Before changing registry this gives #NULL
- After changing registry the formula gives the expected response.
This solution leaves a big question unanswered. Why is tls1.2 treated
differently under Excel?
The addin reports that the same 4.8.4420.0 framework version is being used as
in my stand-alone test.
(from System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription)
Yet without changing the registry values Excel will fail to connect but a stand-alone will work.--
You received this message because you are subscribed to a topic in the Google Groups "Excel-DNA" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/exceldna/qWZMXjDXkW8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/c1389cad-9641-4597-bfe4-5dbce68a2224n%40googlegroups.com.
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to exceldna+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/exceldna/CAC%2BpVYbu0BFjaHOrmzKfzPUcF8yy9Mt%2BKZticEEf4SXk0k1zzA%40mail.gmail.com.