You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor SQL Server setup and connection handling with TLS support
- Updated SQL Server resource to configure a TLS cert when one is configured, and remove the TLS validation bypass from the connection string
- Updated Playground app host to include sql with no TLS, and renamed resources to make their purpose clearer
Copy file name to clipboardExpand all lines: playground/SqlServerEndToEnd/SqlServerEndToEnd.AppHost/AppHost.cs
+13-8Lines changed: 13 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,24 +1,29 @@
1
1
// Licensed to the .NET Foundation under one or more agreements.
2
2
// The .NET Foundation licenses this file to you under the MIT license.
3
3
4
+
#pragma warning disable ASPIRECERTIFICATES001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
Copy file name to clipboardExpand all lines: src/Aspire.Hosting.SqlServer/SqlServerBuilderExtensions.cs
+53-1Lines changed: 53 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,9 +9,12 @@
9
9
usingMicrosoft.Data.SqlClient;
10
10
usingMicrosoft.Extensions.DependencyInjection;
11
11
usingMicrosoft.Extensions.Logging;
12
+
usingAspire.Hosting.Utils;
12
13
13
14
namespaceAspire.Hosting;
14
15
16
+
#pragma warning disable ASPIRECERTIFICATES001// Type is for evaluation purposes only and is subject to change or removal in future updates. Suppress this diagnostic to proceed.
17
+
15
18
/// <summary>
16
19
/// Provides extension methods for adding SQL Server resources to the application model.
17
20
/// </summary>
@@ -49,7 +52,7 @@ public static IResourceBuilder<SqlServerServerResource> AddSqlServer(this IDistr
49
52
varhealthCheckKey=$"{name}_check";
50
53
builder.Services.AddHealthChecks().AddSqlServer(sp =>connectionString??thrownewInvalidOperationException("Connection string is unavailable"),name:healthCheckKey);
/// <para>User and password credentials are not included in the JDBC connection string. Use the <c>Username</c> and <c>Password</c> connection properties to access credentials.</para>
/// Gets the connection string for the SQL Server.
116
125
/// </summary>
117
126
/// <param name="cancellationToken"> A <see cref="CancellationToken"/> to observe while waiting for the task to complete.</param>
118
-
/// <returns>A connection string for the SQL Server in the form "Server=host,port;User ID=sa;Password=password;TrustServerCertificate=true".</returns>
127
+
/// <returns>A connection string for the SQL Server in the form "Server=host,port;User ID=sa;Password=password", with "TrustServerCertificate=true" appended when TLS certificate material is not configured.</returns>
0 commit comments