Skip to content

Commit 784ca21

Browse files
plooploopsAndy Gee
andauthored
Notes for including SSL dependencies (#21262)
* Notes for including SSL dependencies * lint for ssl * clarify based on suggestions Co-authored-by: Andy Gee <[email protected]>
1 parent 069ff71 commit 784ca21

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

docs/core/deploying/trim-self-contained.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,39 @@ When the code is indirectly referencing an assembly through reflection, you can
3232
</ItemGroup>
3333
```
3434

35+
### Support for SSL certificates
36+
37+
If your app loads SSL certificates, such as in an ASP.NET Core app, you'll want to ensure that when trimming you prevent trimming assemblies that will help with loading SSL certificates.
38+
39+
We can update our project file to include the following for ASP.NET Core 3.1:
40+
41+
```xml
42+
<Project Sdk="Microsoft.NET.Sdk.Web">
43+
<PropertyGroup>...</PropertyGroup>
44+
<!--Include the following for .aspnetcore 3.1-->
45+
<ItemGroup>
46+
<TrimmerRootAssembly Include="System.Net" />
47+
<TrimmerRootAssembly Include="System.Net.Security" />
48+
<TrimmerRootAssembly Include="System.Security" />
49+
</ItemGroup>
50+
...
51+
</Project>
52+
```
53+
54+
If we're using .Net 5.0, we can update our project file to include the following:
55+
56+
```xml
57+
<Project Sdk="Microsoft.NET.Sdk.Web">
58+
<PropertyGroup>...</PropertyGroup>
59+
<!--Include the following for .net 5.0-->
60+
<ItemGroup>
61+
<TrimmerRootAssembly Include="System.Net.Security" />
62+
<TrimmerRootAssembly Include="System.Security" />
63+
</ItemGroup>
64+
...
65+
</Project>
66+
```
67+
3568
## Trim your app - CLI
3669

3770
Trim your application using the [dotnet publish](../tools/dotnet-publish.md) command. When you publish your app, set the following properties:

0 commit comments

Comments
 (0)