@@ -10,38 +10,38 @@ import cats.syntax.all.*
10
10
11
11
import cats .effect .*
12
12
13
- import fs2 .text
14
13
import fs2 .io .file .*
15
14
import fs2 .io .net .tls .SecureContext
15
+ import fs2 .text
16
16
17
17
class TLSConnectionTest extends FTestPlatform :
18
18
19
19
test(" Verify that you can connect to MySQL with a TLS connection" ) {
20
20
assertIO(
21
21
for
22
- ca <- Files [IO ].readAll(Path (" database/ssl/ca.pem" )).through(text.utf8.decode).compile.string
22
+ ca <- Files [IO ].readAll(Path (" database/ssl/ca.pem" )).through(text.utf8.decode).compile.string
23
23
cert <- Files [IO ].readAll(Path (" database/ssl/client-cert.pem" )).through(text.utf8.decode).compile.string
24
- key <- Files [IO ].readAll(Path (" database/ssl/client-key.pem" )).through(text.utf8.decode).compile.string
24
+ key <- Files [IO ].readAll(Path (" database/ssl/client-key.pem" )).through(text.utf8.decode).compile.string
25
25
secureContext = SecureContext (
26
- ca = List (ca.asRight).some,
27
- cert = List (cert.asRight).some,
28
- key = List (SecureContext .Key (key.asRight, None )).some
29
- )
26
+ ca = List (ca.asRight).some,
27
+ cert = List (cert.asRight).some,
28
+ key = List (SecureContext .Key (key.asRight, None )).some
29
+ )
30
30
result <- ConnectionProvider
31
- .default[IO ](
32
- " 127.0.0.1" ,
33
- 13306 ,
34
- " ldbc_ssl_user" ,
35
- " securepassword" ,
36
- " world"
37
- )
38
- .setSSL(SSL .fromSecureContext(secureContext))
39
- .use { conn =>
40
- for
41
- statement <- conn.createStatement()
42
- result <- statement.executeQuery(" SELECT 1" )
43
- yield result.getInt(1 )
44
- }
31
+ .default[IO ](
32
+ " 127.0.0.1" ,
33
+ 13306 ,
34
+ " ldbc_ssl_user" ,
35
+ " securepassword" ,
36
+ " world"
37
+ )
38
+ .setSSL(SSL .fromSecureContext(secureContext))
39
+ .use { conn =>
40
+ for
41
+ statement <- conn.createStatement()
42
+ result <- statement.executeQuery(" SELECT 1" )
43
+ yield result.getInt(1 )
44
+ }
45
45
yield result,
46
46
1
47
47
)
0 commit comments