Cosmin Victor Celea
06/11/2020, 8:00 AMGET /api/personer/47120999865 HTTP/2
Host: localhost:8443
User-Agent: curl/7.64.1
Accept: /* Connection state changed (MAX_CONCURRENT_STREAMS == 128)! * TLSv1.2 (IN), TLS alert, close notify (256): * Empty reply from server * Connection #0 to host localhost left intact curl: (52) Empty reply from server * Closing connection 0
s4nchez
06/11/2020, 8:24 AMCosmin Victor Celea
06/11/2020, 8:25 AMGET /api/personer/47120999865 HTTP/2
Host: localhost:8443
User-Agent: curl/7.64.1
Accept: /* Connection state changed (MAX_CONCURRENT_STREAMS == 128)! * TLSv1.2 (IN), TLS alert, close notify (256): * Empty reply from server * Connection #0 to host localhost left intact curl: (52) Empty reply from se
s4nchez
06/11/2020, 8:28 AMCosmin Victor Celea
06/11/2020, 8:28 AMs4nchez
06/11/2020, 8:30 AMCosmin Victor Celea
06/11/2020, 8:30 AMs4nchez
06/11/2020, 8:31 AMCosmin Victor Celea
06/11/2020, 8:31 AMs4nchez
06/11/2020, 8:34 AMCosmin Victor Celea
06/11/2020, 9:47 AMhttp2(port,"src/main/resources/certificates/bits.jks", "pass"))
httpResponse = Response(Status.OK)
httpResponse
s4nchez
06/11/2020, 9:51 AMCosmin Victor Celea
06/11/2020, 9:51 AMfun http2(http2Port: Int, keystorePath: String, keystorePassword: String): ConnectorBuilder =
{ server: Server ->
ServerConnector(server,
SslConnectionFactory(
SslContextFactory.Server().apply {
keyStorePath = keystorePath
setKeyStorePassword(keystorePassword)
cipherComparator = COMPARATOR
provider = "Conscrypt"
},
"alpn"),
ALPNServerConnectionFactory().apply {
defaultProtocol = "h2"
},
HTTP2ServerConnectionFactory(HttpConfiguration().apply {
sendServerVersion = false
secureScheme = "https"
securePort = http2Port
addCustomizer(SecureRequestCustomizer())
})).apply { port = http2Port }
}
s4nchez
06/11/2020, 10:01 AMCosmin Victor Celea
06/11/2020, 10:02 AMs4nchez
06/11/2020, 11:52 AMCosmin Victor Celea
06/11/2020, 12:25 PMs4nchez
06/11/2020, 12:29 PMALPNServerConnectionFactory
. This is enough to make it fail (even on IntelliJ for me):
fun http2(http2Port: Int): ConnectorBuilder =
{ server: Server ->
ServerConnector(server,
ALPNServerConnectionFactory().apply {
defaultProtocol = "h2"
}
).apply { port = http2Port }
}
dave
06/11/2020, 12:31 PM"org.mortbay.jetty.alpn:alpn-boot:8.1.12.v20180117" // this version depends on your version of JDK!
Cosmin Victor Celea
06/11/2020, 12:32 PMs4nchez
06/11/2020, 12:33 PMfun http2(http2Port: Int): ConnectorBuilder =
{ server: Server ->
ServerConnector(server,
HTTP2ServerConnectionFactory(HttpConfiguration().apply {
sendServerVersion = false
})
).apply { port = http2Port }
}
And the hitting it via curl --http2-prior-knowledge -v <http://localhost:8081>
dave
06/11/2020, 12:33 PMOk, I am confusedThis is standard with http2! 😂
Cosmin Victor Celea
06/11/2020, 12:33 PMdave
06/11/2020, 12:33 PMCosmin Victor Celea
06/11/2020, 12:34 PMdave
06/11/2020, 12:34 PMCosmin Victor Celea
06/11/2020, 12:37 PMdave
06/11/2020, 12:38 PMs4nchez
06/11/2020, 12:39 PMCosmin Victor Celea
06/11/2020, 12:40 PMs4nchez
06/11/2020, 12:42 PMdave
06/11/2020, 12:43 PMCosmin Victor Celea
06/11/2020, 12:44 PM