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
System.TypeInitializationException
HResult=0x80131534
Message=The type initializer for'DotNet.Testcontainers.Configurations.TestcontainersSettings' threw an exception.
Source=Testcontainers
StackTrace:
at DotNet.Testcontainers.Configurations.TestcontainersSettings.get_OS()
at DotNet.Testcontainers.Builders.AbstractBuilder`4.Init()
at DotNet.Testcontainers.Builders.ContainerBuilder`3.Init()
at Testcontainers.MsSql.MsSqlBuilder.Init()
at Testcontainers.MsSql.MsSqlBuilder..ctor()
at <REDACTED>
This exception was originally thrown at this call stack:
System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadCertificate(Interop.Crypt32.CertQueryObjectType, void*)
System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadCertificatePal(System.ReadOnlySpan<byte>)
System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadCertificate(System.ReadOnlySpan<byte>)
System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadCertificate(byte[])
DotNet.Testcontainers.Builders.MTlsEndpointAuthenticationProvider.GetClientCertificate()
DotNet.Testcontainers.Builders.MTlsEndpointAuthenticationProvider.GetAuthConfig()
DotNet.Testcontainers.Builders.DockerEndpointAuthenticationProvider.IsAvailable()
DotNet.Testcontainers.Configurations.TestcontainersSettings..cctor.AnonymousMethod__2_1(DotNet.Testcontainers.Builders.IDockerEndpointAuthenticationProvider)
DotNet.Testcontainers.Configurations.TestcontainersSettings.TestcontainersSettings()
Inner Exception 1:
CryptographicException: Cannot find the requested object.
Additional information
No response
The text was updated successfully, but these errors were encountered:
Testcontainers version
4.1.0
Using the latest Testcontainers version?
Yes
Host OS
Windows
Host arch
x86
.NET version
9
Docker version
Client: Version: 26.1.0-rd API version: 1.45 Go version: go1.21.9 Git commit: cca8e72 Built: Tue Apr 23 16:26:59 2024 OS/Arch: windows/amd64 Context: default Server: Docker Engine - Community Engine: Version: 27.4.1 API version: 1.47 (minimum version 1.24) Go version: go1.22.10 Git commit: c710b88 Built: Tue Dec 17 15:45:42 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.32 GitCommit: 8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89 runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
Docker info
What happened?
We're using a TestContainers properties file with the following lines:
When TestContainers tries to load our client certificate using the
X509CertificateLoader.LoadCertificate
method (here: https://github.com/testcontainers/testcontainers-dotnet/blob/4.1.0/src/Testcontainers/Builders/MTlsEndpointAuthenticationProvider.cs#L59), it throws an exception. This is happening because the certificate is being exported as PFX aka. PKCS12 whichX509CertificateLoader.LoadCertificate
does not support, the methodX509CertificateLoader.LoadPkcs12
should be used instead.Relevant log output
Additional information
No response
The text was updated successfully, but these errors were encountered: