Skip to content

Commit

Permalink
Update netty dependency to 4.1.32 (#1160)
Browse files Browse the repository at this point in the history
Also:
* explicitely set endpoint identification algorithm in strict mode
* force TLS protocols 1.2/1.3 in strict mode

Co-Authored-By: Bastien Teinturier <[email protected]>
  • Loading branch information
pm47 and t-bast committed Oct 3, 2019
1 parent c968d06 commit 80a27cc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion eclair-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 80a27cc

Please sign in to comment.