Home
%3CLINGO-SUB%20id%3D%22lingo-sub-364458%22%20slang%3D%22en-US%22%3EWCF%20Applications%20and%20TLS%201.2%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-364458%22%20slang%3D%22en-US%22%3E%3CP%3EAccording%20to%20article%20%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Fnetwork-programming%2Ftls%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Fnetwork-programming%2Ftls%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EWCF%20Supports%20TLS1.0%2C%201.1%20and%201.2%20as%20the%20default%20in%20.NET%20Framework%204.7.%20Starting%20with%20.NET%20Framework%204.7.1%2C%20WCF%20defaults%20to%20the%20operating%20system%20configured%20version%2C%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIf%20you%20are%20targeting%20your%20application%20to%204.7.1%2C%20WCF%20is%20configured%20to%20allow%20the%20OS%20to%20choose%20the%20best%20security%20protocol%20by%20default%20unless%20explicitly%20configured.%20To%20Target%204.7.1%2C%20we%20need%20to%20set%20%26lt%3B%20httpRuntime%20targetFramework%3D%224.7.1%22%20%2F%26gt%3B%20in%20web.config.%20If%20not%2C%20it%20will%20fall%20back%20to%204.5%20default%20behavior%2C%20it%20means%20to%20select%20SSL3.0%20and%20TLS1.0%20as%20default%20protocols.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CCONFIGURATION%3E%3C%2FCONFIGURATION%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%3CSYSTEM.WEB%3E%3C%2FSYSTEM.WEB%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CFONT%20color%3D%22%233366ff%22%3E%26lt%3B%20httpRuntime%20targetFramework%3D%224.7.1%22%20%2F%26gt%3B%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CP%3E%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EThis%20suggests%20our%20WCF%20application%20would%20choose%20TLS1.2%20if%20OS%20is%20configured%20properly.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EIn%20console%20app%20scenario%2C%20the%20same%20is%20achieved%20by%20setting%20%3CSUPPORTEDRUNTIME%20version%3D%22%26quot%3Bv4.0%26quot%3B%22%20sku%3D%22%26quot%3B.NETFramework%2CVersion%3Dv4.7.1%26quot%3B%2F%22%3E%20in%20your%20application%20configuration%20file.%3C%2FSUPPORTEDRUNTIME%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CCONFIGURATION%3E%3C%2FCONFIGURATION%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%3CSTARTUP%3E%3C%2FSTARTUP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3CFONT%20color%3D%22%233366ff%22%3E%3CSUPPORTEDRUNTIME%20version%3D%22%26quot%3Bv4.0%26quot%3B%22%20sku%3D%22%26quot%3B.NETFramework%2CVersion%3Dv4.7%26quot%3B%2F%22%3E%3C%2FSUPPORTEDRUNTIME%3E%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%26nbsp%3B%20%3C%2FP%3E%0A%3CP%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAdditional%20information%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Fmigration-guide%2Fretargeting%2F4.5.2-4.7.2%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Fmigration-guide%2Fretargeting%2F4.5.2-4.7.2%3C%2FA%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Fconfigure-apps%2Ffile-schema%2Fstartup%2Fsupportedruntime-element%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fdotnet%2Fframework%2Fconfigure-apps%2Ffile-schema%2Fstartup%2Fsupportedruntime-element%3C%2FA%3E%3C%2FP%3E
Microsoft

According to article https://docs.microsoft.com/en-us/dotnet/framework/network-programming/tls

 

WCF Supports TLS1.0, 1.1 and 1.2 as the default in .NET Framework 4.7. Starting with .NET Framework 4.7.1, WCF defaults to the operating system configured version,

 

If you are targeting your application to 4.7.1, WCF is configured to allow the OS to choose the best security protocol by default unless explicitly configured. To Target 4.7.1, we need to set < httpRuntime targetFramework="4.7.1" /> in web.config. If not, it will fall back to 4.5 default behavior, it means to select SSL3.0 and TLS1.0 as default protocols.

 

<configuration>

   <system.web>

     < httpRuntime targetFramework="4.7.1" />

   </system.web>

</configuration>

 

This suggests our WCF application would choose TLS1.2 if OS is configured properly.

 

In console app scenario, the same is achieved by setting <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.1"/> in your application configuration file.

 

<configuration>

   <startup>

       <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7"/>

   </startup>

</configuration>

 

Additional information:

 

https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/retargeting/4.5.2-4.7.2

 

https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/startup/supportedruntim...