-
-
Notifications
You must be signed in to change notification settings - Fork 307
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Mutual TLS on Windows in .NET 9 does not work #1319
Comments
I upgraded TestContainers to 4.1.0 from 4.0.0 in a .net 9 project. 4.0.0 : My certs configuration is working all right. I can start As I'm not fluent in cert configuration, I followed these docs :
The change to |
I had the same thought when I was reviewing the change. For Windows, we already expected the certificate to be in PKCS12 format (that's why I didn't request a change). Checking the format beforehand sounds much better. I agree. |
Could you reopen the bug please ? |
I prefer to address this in a new issue. I can create one in the next few days. |
I am confused as well now @jvmdc ! I'll wait till next version is released then. |
Yes, the fix has not been published yet. I probably mixed something up. I thought @tisonv asked about supporting PEM files in Windows, but that should already work since we initially load PEM files, not PKCS12, which is binary - sorry. |
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: