OSGP / Documentation

This repository contains documentation for the Open Smart Grid Platform project. This repository is built as a GitBook, therefore all content has to be written using markdown syntax. See the latest GitBook:
https://documentation.gxf.lfenergy.org/
Apache License 2.0
24 stars 15 forks source link

SSL Handshake failed error #279

Closed Andrej-Velevski closed 1 year ago

Andrej-Velevski commented 2 years ago

Hello,

I'm trying to establish a secure connection to the tomcat web server and send a SetLightRequest. This works fine from SoapUI within the VM, however I'm having trouble doing this from outside the VM.

The issue is related to #277

I am trying to replicate the SetLightOn from this SoapUI request: image

I have a basic console application that is sending a POST request with the exact data, however I get an SSL handshake failed error:

These are the headers I'm setting, some are automatically set like "Content-Length" in the library I'm using. It also uses OpenSSL which has worked for other APIs requiring a secure connection.

request.setRawHeader("Accept-Encoding", "gzip,deflate");
request.setRawHeader("Content-Type", "text/xml;charset=UTF-8");
request.setRawHeader("SOAPAction", "");
request.setRawHeader("Authorization", "Bearer MIGHAgEAMBMGByqGSM49AgEGCCqGSM49AwEHBG0wawIBAQQgFxcrXPtjXD2aRDCpU+ZFEB3UIUpWdEvejKY3LPonQcqhRANCAASjDsJZHsSI0NG3VdD+HVSssTbjNjcGQDnzaZ+LLBnaHy0+TCV4IF9zIt5m9LRPg0bP7PM7kJmmGUPVNC2Mv9le");
request.setUrl("https://192.168.0.111:443/osgp-adapter-ws-publiclighting/publiclighting/adHocManagementService/");

I'm not sure if the issue has something to do with the Authorization header (since I get the same issue if I remove it) or something with certificates.

If I try to use the port 12122 instead of 443 I get the following exception in the tomcat web server:

2022-09-01 08:59:04.175] [dev-box] [disposableNioEventLoopGroup-4-4] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0xae2fa4c7, L:/192.168.0.111:12122 - R:/192.168.0.106:59934] READ COMPLETE
2022-09-01 08:59:04.177] [dev-box] [disposableNioEventLoopGroup-4-4] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0xae2fa4c7, L:/192.168.0.111:12122 ! R:/192.168.0.106:59934] INACTIVE
2022-09-01 08:59:04.178] [dev-box] [disposableNioEventLoopGroup-4-4] INFO o.o.a.p.o.e.i.n.OslpChannelHandlerServer@channelInactive:91 - Channel [ae2fa4c7] inactive.
2022-09-01 08:59:04.178] [dev-box] [disposableNioEventLoopGroup-4-4] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0xae2fa4c7, L:/192.168.0.111:12122 ! R:/192.168.0.106:59934] UNREGISTERED
2022-09-01 09:13:24.191] [dev-box] [disposableNioEventLoopGroup-4-5] INFO o.o.a.p.o.e.a.config.OslpConfig@initChannel:123 - Created server new pipeline
2022-09-01 09:13:24.192] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 - R:/192.168.0.106:59985] REGISTERED
2022-09-01 09:13:24.192] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 - R:/192.168.0.106:59985] ACTIVE
2022-09-01 09:13:24.192] [dev-box] [disposableNioEventLoopGroup-4-5] INFO o.o.a.p.o.e.i.n.OslpChannelHandlerServer@channelActive:85 - Channel [1a37e4e2] active.
2022-09-01 09:13:24.201] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 - R:/192.168.0.106:59985] READ: 517B
2022-09-01 09:13:24.202] [dev-box] [disposableNioEventLoopGroup-4-5] WARN o.o.a.p.o.e.i.n.OslpChannelHandlerServer@exceptionCaught:103 - Channel [080027fffef8e38d-0000416c-00000005-eec75350843397de-1a37e4e2] - Unexpected exception from downstream.
io.netty.handler.codec.DecoderException: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
    at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
    at com.google.protobuf.InvalidProtocolBufferException.invalidTag(InvalidProtocolBufferException.java:68)
    at com.google.protobuf.CodedInputStream.readTag(CodedInputStream.java:108)
    at org.opensmartgridplatform.oslp.Oslp$Message$Builder.mergeFrom(Oslp.java:3784)
    at org.opensmartgridplatform.oslp.Oslp$Message$Builder.mergeFrom(Oslp.java:1)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:300)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238)
    at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:162)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:716)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238)
    at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:153)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:709)
    at org.opensmartgridplatform.oslp.Oslp$Message.parseFrom(Oslp.java:2599)
    at org.opensmartgridplatform.oslp.OslpDecoder.decodePayload(OslpDecoder.java:138)
    at org.opensmartgridplatform.oslp.OslpDecoder.decode(OslpDecoder.java:74)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
    at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
    ... 21 common frames omitted
2022-09-01 09:13:24.202] [dev-box] [disposableNioEventLoopGroup-4-5] WARN i.n.c.AbstractChannelHandlerContext@invokeExceptionCaught:311 - An exception 'java.lang.NullPointerException' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception:
io.netty.handler.codec.DecoderException: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
    at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:276)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.handler.logging.LoggingHandler.channelRead(LoggingHandler.java:271)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:357)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1410)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:379)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:365)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:919)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).
    at com.google.protobuf.InvalidProtocolBufferException.invalidTag(InvalidProtocolBufferException.java:68)
    at com.google.protobuf.CodedInputStream.readTag(CodedInputStream.java:108)
    at org.opensmartgridplatform.oslp.Oslp$Message$Builder.mergeFrom(Oslp.java:3784)
    at org.opensmartgridplatform.oslp.Oslp$Message$Builder.mergeFrom(Oslp.java:1)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:300)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238)
    at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:162)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:716)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238)
    at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:153)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:709)
    at org.opensmartgridplatform.oslp.Oslp$Message.parseFrom(Oslp.java:2599)
    at org.opensmartgridplatform.oslp.OslpDecoder.decodePayload(OslpDecoder.java:138)
    at org.opensmartgridplatform.oslp.OslpDecoder.decode(OslpDecoder.java:74)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
    at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
    ... 21 common frames omitted
2022-09-01 09:13:24.202] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 - R:/192.168.0.106:59985] READ COMPLETE
2022-09-01 09:14:06.151] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 - R:/192.168.0.106:59985] READ COMPLETE
2022-09-01 09:14:06.152] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:102 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 - R:/192.168.0.106:59985] EXCEPTION: java.io.IOException: Connection reset by peer
java.io.IOException: Connection reset by peer
    at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
    at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
    at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
    at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
    at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
    at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:356)
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1134)
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)
2022-09-01 09:14:06.152] [dev-box] [disposableNioEventLoopGroup-4-5] INFO o.o.a.p.o.e.i.n.OslpChannelHandlerServer@exceptionCaught:101 - Channel [080027fffef8e38d-0000416c-00000005-eec75350843397de-1a37e4e2] - Connection was (as expected) reset by the device.
2022-09-01 09:14:06.152] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 - R:/192.168.0.106:59985] CLOSE
2022-09-01 09:14:06.153] [dev-box] [disposableNioEventLoopGroup-4-5] WARN i.n.channel.DefaultChannelPipeline@onUnhandledInboundException:1152 - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: Connection reset by peer
    at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
    at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
    at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
    at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
    at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
    at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:356)
    at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:253)
    at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1134)
    at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:350)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:714)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:650)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:576)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:493)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)
2022-09-01 09:14:06.153] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 ! R:/192.168.0.106:59985] USER_EVENT: io.netty.channel.socket.ChannelInputShutdownReadComplete@52ccf24a
2022-09-01 09:14:06.153] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 ! R:/192.168.0.106:59985] INACTIVE
2022-09-01 09:14:06.153] [dev-box] [disposableNioEventLoopGroup-4-5] INFO o.o.a.p.o.e.i.n.OslpChannelHandlerServer@channelInactive:91 - Channel [1a37e4e2] inactive.
2022-09-01 09:14:06.153] [dev-box] [disposableNioEventLoopGroup-4-5] WARN o.o.a.p.o.e.i.n.OslpChannelHandlerServer@exceptionCaught:103 - Channel [080027fffef8e38d-0000416c-00000005-eec75350843397de-1a37e4e2] - Unexpected exception from downstream.
io.netty.handler.codec.DecoderException: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either than the input has been truncated or that an embedded message misreported its own length.
    at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
    at io.netty.handler.codec.ReplayingDecoder.channelInputClosed(ReplayingDecoder.java:329)
    at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:371)
    at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:354)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
    at io.netty.handler.logging.LoggingHandler.channelInactive(LoggingHandler.java:197)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:497)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either than the input has been truncated or that an embedded message misreported its own length.
    at com.google.protobuf.InvalidProtocolBufferException.truncatedMessage(InvalidProtocolBufferException.java:49)
    at com.google.protobuf.CodedInputStream.readRawBytes(CodedInputStream.java:754)
    at com.google.protobuf.CodedInputStream.readBytes(CodedInputStream.java:294)
    at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:484)
    at com.google.protobuf.GeneratedMessage$Builder.parseUnknownField(GeneratedMessage.java:438)
    at org.opensmartgridplatform.oslp.Oslp$Message$Builder.mergeFrom(Oslp.java:3791)
    at org.opensmartgridplatform.oslp.Oslp$Message$Builder.mergeFrom(Oslp.java:1)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:300)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238)
    at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:162)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:716)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238)
    at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:153)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:709)
    at org.opensmartgridplatform.oslp.Oslp$Message.parseFrom(Oslp.java:2599)
    at org.opensmartgridplatform.oslp.OslpDecoder.decodePayload(OslpDecoder.java:138)
    at org.opensmartgridplatform.oslp.OslpDecoder.decode(OslpDecoder.java:74)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
    at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
    ... 22 common frames omitted
2022-09-01 09:14:06.154] [dev-box] [disposableNioEventLoopGroup-4-5] WARN i.n.c.AbstractChannelHandlerContext@invokeExceptionCaught:311 - An exception 'java.lang.NullPointerException' [enable DEBUG level for full stacktrace] was thrown by a user handler's exceptionCaught() method while handling the following exception:
io.netty.handler.codec.DecoderException: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either than the input has been truncated or that an embedded message misreported its own length.
    at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:421)
    at io.netty.handler.codec.ReplayingDecoder.channelInputClosed(ReplayingDecoder.java:329)
    at io.netty.handler.codec.ByteToMessageDecoder.channelInputClosed(ByteToMessageDecoder.java:371)
    at io.netty.handler.codec.ByteToMessageDecoder.channelInactive(ByteToMessageDecoder.java:354)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
    at io.netty.handler.logging.LoggingHandler.channelInactive(LoggingHandler.java:197)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelInactive(AbstractChannelHandlerContext.java:241)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelInactive(DefaultChannelPipeline.java:1405)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:262)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelInactive(AbstractChannelHandlerContext.java:248)
    at io.netty.channel.DefaultChannelPipeline.fireChannelInactive(DefaultChannelPipeline.java:901)
    at io.netty.channel.AbstractChannel$AbstractUnsafe$8.run(AbstractChannel.java:819)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:497)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: com.google.protobuf.InvalidProtocolBufferException: While parsing a protocol message, the input ended unexpectedly in the middle of a field.  This could mean either than the input has been truncated or that an embedded message misreported its own length.
    at com.google.protobuf.InvalidProtocolBufferException.truncatedMessage(InvalidProtocolBufferException.java:49)
    at com.google.protobuf.CodedInputStream.readRawBytes(CodedInputStream.java:754)
    at com.google.protobuf.CodedInputStream.readBytes(CodedInputStream.java:294)
    at com.google.protobuf.UnknownFieldSet$Builder.mergeFieldFrom(UnknownFieldSet.java:484)
    at com.google.protobuf.GeneratedMessage$Builder.parseUnknownField(GeneratedMessage.java:438)
    at org.opensmartgridplatform.oslp.Oslp$Message$Builder.mergeFrom(Oslp.java:3791)
    at org.opensmartgridplatform.oslp.Oslp$Message$Builder.mergeFrom(Oslp.java:1)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:300)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238)
    at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:162)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:716)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:238)
    at com.google.protobuf.AbstractMessageLite$Builder.mergeFrom(AbstractMessageLite.java:153)
    at com.google.protobuf.AbstractMessage$Builder.mergeFrom(AbstractMessage.java:709)
    at org.opensmartgridplatform.oslp.Oslp$Message.parseFrom(Oslp.java:2599)
    at org.opensmartgridplatform.oslp.OslpDecoder.decodePayload(OslpDecoder.java:138)
    at org.opensmartgridplatform.oslp.OslpDecoder.decode(OslpDecoder.java:74)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:501)
    at io.netty.handler.codec.ReplayingDecoder.callDecode(ReplayingDecoder.java:366)
    ... 22 common frames omitted
2022-09-01 09:14:06.154] [dev-box] [disposableNioEventLoopGroup-4-5] INFO i.n.handler.logging.LoggingHandler@log:148 - [id: 0x1a37e4e2, L:/192.168.0.111:12122 ! R:/192.168.0.106:59985] UNREGISTERED

I've also tried using ReqBin where using the port 443 I get "Error sending request" and using the port 12122 I get "Request timeout".

Any help would be appreciated.

Thank you

kevinsmeets commented 2 years ago

Hello @Andrej-Velevski ,

sending a SOAP message to port 12122 will not work; this port is used by one of the protocol adapter components and does not use SOAP as a communication protocol.

You will need to create a server certificate and configure Apache HTTPD with this certificate. It is Apache HTTPD that handles the SSL handshake.

The authorization header you are setting is not needed; instead, you will have to use the client certificate for the organization used in your SOAP message.