Skip to content

Commit 89977a6

Browse files
Update transport-layer-security-configure-client-version.md due to ServicePointManager being obsolete
1 parent 90dcb56 commit 89977a6

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)