Skip to content

Commit ed98760

Browse files
committed
#1626 WiP
1 parent c735d6d commit ed98760

6 files changed

Lines changed: 69 additions & 24 deletions

File tree

vuu/src/main/scala/org/finos/vuu/net/ws/WebSocketClient.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,6 @@ class WebSocketClient(url: String, port: Int)(implicit lifecycle: LifecycleConta
6363

6464
})
6565

66-
//Thread.sleep(2000)
67-
6866
ch = b.connect(uri.getHost, port).sync.channel
6967
}
7068

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-----BEGIN CERTIFICATE-----
2+
MIIC3jCCAcYCCQDluS1n11toPDANBgkqhkiG9w0BAQsFADAxMQswCQYDVQQGEwJH
3+
QjEOMAwGA1UECgwFVmVudXUxEjAQBgNVBAMMCWxvY2FsaG9zdDAeFw0yMTAzMTgw
4+
OTUzMzVaFw0zMTAzMTYwOTUzMzVaMDExCzAJBgNVBAYTAkdCMQ4wDAYDVQQKDAVW
5+
ZW51dTESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
6+
MIIBCgKCAQEAoXS+P4cOprmMIByOOD4+O69Qfnjmrh2Raq5DBHmEDObqF6mA2E+o
7+
SSRvPTdTsufK0tIKQM7iH8ot5P0+ydaVmaHHML7Bys3WYQNfCBm+MZRl79O7yiHX
8+
tZYtIiJoagiQ4IX19Q00tkaNPqsj5ANBfKVtzokRzXzw+BjZtZpBXWUeETJE4wGB
9+
5fSQCHMdA8pnblucqsMsmDhGYloH5sBPLIyu9wV/h6AunxhZ37cKlV3U6R8np1ov
10+
T2fW3fHj6LtrUceMiZKWWgM9NrcJyeSZrqtwWe4lS3VeGZbGG1EZ+oc0m4cbv9FI
11+
3pz47cK+NTRQq43JQERmA3Yb9G2xRNFTxQIDAQABMA0GCSqGSIb3DQEBCwUAA4IB
12+
AQB5mMt5eJuwnttcIfv7CKpb9icdYQUsQwN76n33EBetwoBj4r0F2gvxVCUo+9p9
13+
QTWET7K/nnCxB5ToP031baKZBOU8vIwhAU4WT1Y04ydYLu7vWBCVS7Cp1cygeJ5Z
14+
3WufvWo8EEqRhAKYFKIj0bj9XP6yOOBSNlmQk5VRRMKLp9aqmT1rV6+IgS6RJQim
15+
heZVnEUuKkHo6HZygv3Pl6DMXzD+pawcfYh7HYf+70qzmKvfBZkDE8x74KvdQ21V
16+
7bYRiL+yglzpkYPcAdpUAoHEUwh4DuCcaDUdGgGCBzjh7QJNvel5HccpXSGbrezY
17+
wYfUHIkVCMlDIRYJJArHJChO
18+
-----END CERTIFICATE-----
File renamed without changes.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
-----BEGIN PRIVATE KEY-----
2+
MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQChdL4/hw6muYwg
3+
HI44Pj47r1B+eOauHZFqrkMEeYQM5uoXqYDYT6hJJG89N1Oy58rS0gpAzuIfyi3k
4+
/T7J1pWZoccwvsHKzdZhA18IGb4xlGXv07vKIde1li0iImhqCJDghfX1DTS2Ro0+
5+
qyPkA0F8pW3OiRHNfPD4GNm1mkFdZR4RMkTjAYHl9JAIcx0DymduW5yqwyyYOEZi
6+
WgfmwE8sjK73BX+HoC6fGFnftwqVXdTpHyenWi9PZ9bd8ePou2tRx4yJkpZaAz02
7+
twnJ5Jmuq3BZ7iVLdV4ZlsYbURn6hzSbhxu/0UjenPjtwr41NFCrjclARGYDdhv0
8+
bbFE0VPFAgMBAAECggEBAIa5QZ8E9YbNwU1yRoJL/eYTzhkajXKwnYzlSGrNcxDJ
9+
BoEkIa1eGtCdpGzyY9cfb7EnLwMRHsLkFBPF9cS6WC7QPcRBCLhPthlRlNTPllMM
10+
v1q11Tc/sh2F6LdY+sOvziRr4+bNVDTc/jNS3yn+RYDbEZuL6N0M6o47Pj85Ll3d
11+
FNHQf/4JHm8H2CpKzumn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TEl8F3iJQLQN
28+
-----END PRIVATE KEY-----

vuu/src/test/scala/org/finos/vuu/net/http/VuuHttp2ServerTest.scala

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ import scala.jdk.CollectionConverters.SetHasAsJava
1818

1919
class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matchers with StrictLogging {
2020

21-
val portCounter = new AtomicInteger(31820)
21+
private val certPath: String = getClass.getClassLoader.getResource("certs/cert.pem").getPath
22+
private val keyPath: String = getClass.getClassLoader.getResource("certs/key.pem").getPath
23+
private val pkcsPath: String = getClass.getClassLoader.getResource("certs/certificate.p12").getPath
24+
private val portCounter = new AtomicInteger(31820)
25+
private val pkcsPassword = "changeit"
2226

2327
Feature("Check we can start the HTTP2 Server with various configurations") {
2428

@@ -43,9 +47,7 @@ class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matc
4347
val port = portCounter.getAndIncrement()
4448

4549
val config = VuuHttp2ServerOptions()
46-
.withSsl(VuuSSLByCertAndKey(
47-
certPath = "example/main/src/main/resources/certs/cert.pem",
48-
keyPath = "example/main/src/main/resources/certs/key.pem"))
50+
.withSsl(VuuSSLByCertAndKey(certPath, keyPath))
4951
.withPort(port)
5052

5153
val webServer = createAndStartWebServer(config)
@@ -61,9 +63,7 @@ class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matc
6163
val port = portCounter.getAndIncrement()
6264

6365
val config = VuuHttp2ServerOptions()
64-
.withSsl(VuuSSLByPKCS(
65-
pkcsPath = "example/main/src/main/resources/certs/certificate.p12",
66-
pkcsPassword = "changeit"))
66+
.withSsl(VuuSSLByPKCS(pkcsPath, pkcsPassword))
6767
.withPort(port)
6868

6969
val webServer = createAndStartWebServer(config)
@@ -80,8 +80,8 @@ class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matc
8080

8181
val config = VuuHttp2ServerOptions()
8282
.withSsl(VuuSSLByPKCS(
83-
pkcsPath = "example/main/src/main/resources/certs/certificate.p12",
84-
pkcsPassword = "changeit",
83+
pkcsPath,
84+
pkcsPassword,
8585
cipherSuite = VuuSSLCipherSuiteOptions()
8686
.withCiphers(List("TLS_AES_256_GCM_SHA384"))
8787
.withProtocols(List("TLSv1.3"))))
@@ -99,10 +99,11 @@ class VuuHttp2ServerTest extends AnyFeatureSpec with AwaitilitySupport with Matc
9999

100100
val port = portCounter.getAndIncrement()
101101

102+
102103
val config = VuuHttp2ServerOptions()
103104
.withSsl(VuuSSLByPKCS(
104-
pkcsPath = "example/main/src/main/resources/certs/certificate.p12",
105-
pkcsPassword = "changeit",
105+
pkcsPath,
106+
pkcsPassword,
106107
cipherSuite = VuuSSLCipherSuiteOptions()
107108
.withCiphers(List("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"))
108109
.withProtocols(List("TLSv1.2"))))

vuu/src/test/scala/org/finos/vuu/net/ws/WebSocketServerTest.scala

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ import java.util.concurrent.atomic.AtomicInteger
1717

1818
class WebSocketServerTest extends AnyFeatureSpec with Matchers with StrictLogging {
1919

20-
val portCounter = new AtomicInteger(31820)
20+
private val certPath: String = getClass.getClassLoader.getResource("certs/cert.pem").getPath
21+
private val keyPath: String = getClass.getClassLoader.getResource("certs/key.pem").getPath
22+
private val pkcsPath: String = getClass.getClassLoader.getResource("certs/certificate.p12").getPath
23+
private val portCounter = new AtomicInteger(31820)
24+
private val pkcsPassword = "changeit"
2125

2226
Feature("Check we can start the WebSocketServer with various configurations") {
2327

@@ -63,9 +67,7 @@ class WebSocketServerTest extends AnyFeatureSpec with Matchers with StrictLoggin
6367
VuuWebSocketOptions()
6468
.withUri("websocket")
6569
.withSsl(
66-
VuuSSLByCertAndKey(
67-
certPath = "example/main/src/main/resources/certs/cert.pem",
68-
keyPath = "example/main/src/main/resources/certs/key.pem"))
70+
VuuSSLByCertAndKey(certPath, keyPath))
6971
.withWsPort(wsPort),
7072
VuuSecurityOptions()
7173
)
@@ -93,9 +95,7 @@ class WebSocketServerTest extends AnyFeatureSpec with Matchers with StrictLoggin
9395
VuuWebSocketOptions()
9496
.withUri("websocket")
9597
.withSsl(
96-
VuuSSLByPKCS(
97-
pkcsPath = "example/main/src/main/resources/certs/certificate.p12",
98-
pkcsPassword = "changeit"))
98+
VuuSSLByPKCS(pkcsPath, pkcsPassword))
9999
.withWsPort(wsPort),
100100
VuuSecurityOptions()
101101
)
@@ -124,8 +124,8 @@ class WebSocketServerTest extends AnyFeatureSpec with Matchers with StrictLoggin
124124
.withUri("websocket")
125125
.withSsl(
126126
VuuSSLByCertAndKey(
127-
certPath = "example/main/src/main/resources/certs/cert.pem",
128-
keyPath = "example/main/src/main/resources/certs/key.pem",
127+
certPath,
128+
keyPath,
129129
cipherSuite = VuuSSLCipherSuiteOptions()
130130
.withCiphers(List("TLS_AES_256_GCM_SHA384"))
131131
.withProtocols(List("TLSv1.3"))
@@ -159,8 +159,8 @@ class WebSocketServerTest extends AnyFeatureSpec with Matchers with StrictLoggin
159159
.withUri("websocket")
160160
.withSsl(
161161
VuuSSLByCertAndKey(
162-
certPath = "example/main/src/main/resources/certs/cert.pem",
163-
keyPath = "example/main/src/main/resources/certs/key.pem",
162+
certPath,
163+
keyPath,
164164
cipherSuite = VuuSSLCipherSuiteOptions()
165165
.withCiphers(List("TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384"))
166166
.withProtocols(List("TLSv1.2"))

0 commit comments

Comments
 (0)