testcontainers / testcontainers-dotnet

A library to support tests with throwaway instances of Docker containers for all compatible .NET Standard versions.
https://dotnet.testcontainers.org
MIT License
3.76k stars 271 forks source link

feat: Use built-in PEM certificate import on .NET 6 and onwards #1139

Closed 0xced closed 6 months ago

0xced commented 6 months ago

What does this PR do?

This pull requests uses the built-in PEM certificate import on .NET 6 onwards and updates the package references conditionally on the target framework.

BouncyCastle.Cryptography, Microsoft.Bcl.AsyncInterfaces and System.Text.Json are now referenced only when targeting .NET Standard (2.0 and 2.1) since they are not needed anymore when targeting .NET 6 onwards.

Why is it important?

This allows to drop the BouncyCastle.Cryptography dependency (almost 7 MB) when targeting net6.0 and net8.0.

Related issues

None, I just saw that .NET 6 and .NET 8 support was added recently and took the opportunity to reduce the dependencies.

How to test this PR

Just run the existing tests and verify that nothing is broken. Note that some care had to be taken on Windows.

netlify[bot] commented 6 months ago

Deploy Preview for testcontainers-dotnet ready!

Name Link
Latest commit c29f89fdc6d93af8aad88ad4a3d9b0b809449813
Latest deploy log https://app.netlify.com/sites/testcontainers-dotnet/deploys/65ef3a681556e90008c1d0f6
Deploy Preview https://deploy-preview-1139--testcontainers-dotnet.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.