1
0
mirror of https://github.com/ACINQ/eclair.git synced 2024-11-19 18:10:42 +01:00

Update netty dependency to 4.1.32 (#1160)

Also:
* explicitely set endpoint identification algorithm in strict mode
* force TLS protocols 1.2/1.3 in strict mode

Co-Authored-By: Bastien Teinturier <31281497+t-bast@users.noreply.github.com>
This commit is contained in:
Pierre-Marie Padiou 2019-10-03 15:01:10 +02:00 committed by GitHub
parent c968d063f6
commit 80a27cc566
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View File

@ -147,7 +147,7 @@
<dependency>
<groupId>io.netty</groupId>
<artifactId>netty-all</artifactId>
<version>4.1.32.Final</version>
<version>4.1.42.Final</version>
</dependency>
<!-- BITCOIN -->
<dependency>

View File

@ -67,7 +67,12 @@ class ElectrumClient(serverAddress: InetSocketAddress, ssl: SSL)(implicit val ec
case SSL.OFF => ()
case SSL.STRICT =>
val sslCtx = SslContextBuilder.forClient.build
ch.pipeline.addLast(sslCtx.newHandler(ch.alloc(), serverAddress.getHostName, serverAddress.getPort))
val handler = sslCtx.newHandler(ch.alloc(), serverAddress.getHostName, serverAddress.getPort)
val sslParameters = handler.engine().getSSLParameters
sslParameters.setEndpointIdentificationAlgorithm("HTTPS")
handler.engine().setSSLParameters(sslParameters)
handler.engine().setEnabledProtocols(Array[String]("TLSv1.2", "TLSv1.3"))
ch.pipeline.addLast(handler)
case SSL.LOOSE =>
// INSECURE VERSION THAT DOESN'T CHECK CERTIFICATE
val sslCtx = SslContextBuilder.forClient().trustManager(InsecureTrustManagerFactory.INSTANCE).build()