Fix to allow equality of hostname (#3381)

* Fix to allow equality of hostname

* Remove unreliable require test per pull 3381

* Remove unreliable require test per pull 3381
This commit is contained in:
gaugfather 2018-06-21 03:03:32 -05:00 committed by Matthew Nesbit
parent ed3944c546
commit 2f34b16b07

View File

@ -171,9 +171,8 @@ internal class AMQPChannelHandler(private val serverMode: Boolean,
// Transfers application packet into the AMQP engine.
is SendableMessageImpl -> {
val inetAddress = InetSocketAddress(msg.destinationLink.host, msg.destinationLink.port)
require(inetAddress == remoteAddress) {
"Message for incorrect endpoint $inetAddress expected $remoteAddress"
}
logDebugWithMDC { "Message for endpoint $inetAddress , expected $remoteAddress "}
require(CordaX500Name.parse(msg.destinationLegalName) == CordaX500Name.build(remoteCert!!.subjectX500Principal)) {
"Message for incorrect legal identity ${msg.destinationLegalName} expected ${remoteCert!!.subjectX500Principal}"
}