You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to make a new implementation of an ISO8583 (currently is builded on jpos) with a client requesting from a server. All this is based on an Spring Boot application with WebFlux and Netty server.
Until know, I have figured how to create an SslHandler but, although I use the same SSLContext as in the previous implementation (in jpos), I keep getting an SslHandshakeTimeoutException.
Additionally, in jpos implementation, I'm using the PADChannel as the server responds with a header.
Any help would be very appreciated:
val c = ClientConfiguration.newBuilder()
.addEchoMessageListener(true)
.addLoggingHandler(true)
.describeFieldsInLog()
.workerThreadsCount(4)
.replyOnError(true)
.build()
val s = Iso8583Client(InetSocketAddress(host, port), c, factory).apply {
setConfigurer(object : ConnectorConfigurer<ClientConfiguration, Bootstrap> {
override fun configurePipeline(pipeline: ChannelPipeline?, configuration: ClientConfiguration?) {
super.configurePipeline(pipeline, configuration)
val ks = KeyStore.getInstance("JKS").apply {
load(ClassPathResource("keystore.jks").inputStream, password.toCharArray())
}
val km = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()).apply {
init(ks, password.toCharArray())
}
val tm = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()).apply {
init(ks)
}
val ctx = SSLContext.getInstance("SSL").apply {
init(km.keyManagers, tm.trustManagers, SecureRandom.getInstance("SHA1PRNG"))
}
val handler = SslHandler(ctx.createSSLEngine().apply { useClientMode = true }).apply {
this.handshakeFuture().addListener { f ->
if(!f.isSuccess) println("SSL handsake failed" + f.cause().message)
}
}
pipeline?.addLast(handler, Iso8583Decoder(isoMessageFactory), Iso8583Encoder(0))
}
})
addMessageListener(object : IsoMessageListener<IsoMessage> {
override fun onMessage(p0: ChannelHandlerContext?, p1: IsoMessage?): Boolean {
println(p1?.debugString())
return true
}
override fun applies(p0: IsoMessage?): Boolean {
println(p0?.debugString())
return true
}
})
}
try {
s.init()
s.connect()
if(s.isConnected) {
println("connected...")
s.send(factory.newMessage(0x9800))
}
} finally {
s.disconnect()
}
}
The error message is obvious and there is no need to post it.
The text was updated successfully, but these errors were encountered:
I am trying to make a new implementation of an ISO8583 (currently is builded on jpos) with a client requesting from a server. All this is based on an Spring Boot application with WebFlux and Netty server.
Until know, I have figured how to create an
SslHandler
but, although I use the sameSSLContext
as in the previous implementation (in jpos), I keep getting anSslHandshakeTimeoutException
.Additionally, in jpos implementation, I'm using the PADChannel as the server responds with a header.
Any help would be very appreciated:
The error message is obvious and there is no need to post it.
The text was updated successfully, but these errors were encountered: