From ad4d60d6407a79f2270d6f839405399bca2125c5 Mon Sep 17 00:00:00 2001 From: Szymon Sasin Date: Mon, 28 Oct 2024 14:27:07 +0200 Subject: [PATCH] feat(netty): require remote address when using DtlsClientHandshakeChannelHandler --- .../org/opencoap/ssl/netty/DtlsClientHandshakeChannelHandler.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/kotlin-mbedtls-netty/src/main/kotlin/org/opencoap/ssl/netty/DtlsClientHandshakeChannelHandler.kt b/kotlin-mbedtls-netty/src/main/kotlin/org/opencoap/ssl/netty/DtlsClientHandshakeChannelHandler.kt index 021def0..f0a8ce6 100644 --- a/kotlin-mbedtls-netty/src/main/kotlin/org/opencoap/ssl/netty/DtlsClientHandshakeChannelHandler.kt +++ b/kotlin-mbedtls-netty/src/main/kotlin/org/opencoap/ssl/netty/DtlsClientHandshakeChannelHandler.kt @@ -51,6 +51,7 @@ class DtlsClientHandshakeChannelHandler( } override fun channelActive(ctx: ChannelHandlerContext) { + require(ctx.channel().remoteAddress() is InetSocketAddress) { "Remote address must be defined" } this.ctx = ctx stepAndSchedule() }