Skip to content

Commit 1d32baf

Browse files
Merge pull request #294024 from EldertGrootenboer/patch-5
Update transport-layer-security-configure-client-version.md
2 parents e5500de + 89977a6 commit 1d32baf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

articles/service-bus-messaging/transport-layer-security-configure-client-version.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ The following sample shows how to enable TLS 1.2 in a .NET client using the Azur
2727
```csharp
2828
{
2929
// Enable TLS 1.2 before connecting to Service Bus
30-
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
30+
HttpClientHandler handler = new HttpClientHandler();
31+
handler.SslProtocols = System.Security.Authentication.SslProtocols.Tls12;
32+
HttpClient httpClient = new HttpClient(handler);
3133

3234
// Connection string to your Service Bus namespace
3335
string connectionString = "<NAMESPACE CONNECTION STRING>";

0 commit comments

Comments
 (0)