@@ -8,6 +8,8 @@ namespace DotNet.Testcontainers.Tests.Unit
8
8
using DotNet . Testcontainers . Configurations ;
9
9
using DotNet . Testcontainers . Tests . Fixtures ;
10
10
using Microsoft . Extensions . Logging . Abstractions ;
11
+ using Org . BouncyCastle . Crypto ;
12
+ using Org . BouncyCastle . Crypto . Parameters ;
11
13
using Xunit ;
12
14
13
15
public static class ProtectDockerDaemonSocketTest
@@ -20,10 +22,12 @@ private static IDockerEndpointAuthenticationConfiguration GetAuthConfig(ProtectD
20
22
21
23
public sealed class MTlsOpenSsl1_1_1 : IClassFixture < OpenSsl1_1_1Fixture >
22
24
{
25
+ private readonly OpenSsl1_1_1Fixture _fixture ;
23
26
private readonly IDockerEndpointAuthenticationConfiguration _authConfig ;
24
27
25
28
public MTlsOpenSsl1_1_1 ( OpenSsl1_1_1Fixture dockerMTlsFixture )
26
29
{
30
+ _fixture = dockerMTlsFixture ;
27
31
_authConfig = GetAuthConfig ( dockerMTlsFixture ) ;
28
32
}
29
33
@@ -35,9 +39,38 @@ public async Task GetVersionReturnsVersion()
35
39
// When
36
40
var version = await client . System . GetVersionAsync ( )
37
41
. ConfigureAwait ( false ) ;
42
+ var key = _fixture . ClientCertificateKey ( ) ;
38
43
39
44
// Then
40
45
Assert . Equal ( OpenSsl1_1_1Fixture . DockerVersion , version . Version ) ;
46
+ Assert . IsType < AsymmetricCipherKeyPair > ( key ) ;
47
+ }
48
+ }
49
+
50
+ public sealed class MTlsOpenSsl3_1 : IClassFixture < OpenSsl3_1Fixture >
51
+ {
52
+ private readonly OpenSsl3_1Fixture _fixture ;
53
+ private readonly IDockerEndpointAuthenticationConfiguration _authConfig ;
54
+
55
+ public MTlsOpenSsl3_1 ( OpenSsl3_1Fixture dockerMTlsFixture )
56
+ {
57
+ _fixture = dockerMTlsFixture ;
58
+ _authConfig = GetAuthConfig ( dockerMTlsFixture ) ;
59
+ }
60
+
61
+ [ Fact ]
62
+ public async Task GetVersionReturnsVersion ( )
63
+ {
64
+ // Given
65
+ var client = new TestcontainersClient ( Guid . Empty , _authConfig , NullLogger . Instance ) ;
66
+ // When
67
+ var version = await client . System . GetVersionAsync ( )
68
+ . ConfigureAwait ( false ) ;
69
+ var key = _fixture . ClientCertificateKey ( ) ;
70
+
71
+ // Then
72
+ Assert . Equal ( OpenSsl3_1Fixture . DockerVersion , version . Version ) ;
73
+ Assert . IsType < RsaPrivateCrtKeyParameters > ( key ) ;
41
74
}
42
75
}
43
76
0 commit comments