mirror of
https://github.com/corda/corda.git
synced 2025-05-29 13:44:25 +00:00
core: Bind client socket to getLocalHost explicitly, fixes #6
This commit is contained in:
parent
cd8abffafe
commit
3f36462053
@ -230,6 +230,10 @@ class X509UtilitiesTest {
|
|||||||
clientParams.endpointIdentificationAlgorithm = "HTTPS" // enable hostname checking
|
clientParams.endpointIdentificationAlgorithm = "HTTPS" // enable hostname checking
|
||||||
clientSocket.sslParameters = clientParams
|
clientSocket.sslParameters = clientParams
|
||||||
clientSocket.useClientMode = true
|
clientSocket.useClientMode = true
|
||||||
|
// We need to specify this explicitly because by default the client binds to 'localhost' and we want it to bind
|
||||||
|
// to whatever <hostname> resolves to(as that's what the server binds to). In particular on Debian <hostname>
|
||||||
|
// resolves to 127.0.1.1 instead of the external address of the interface, so the ssl handshake fails.
|
||||||
|
clientSocket.bind(InetSocketAddress(InetAddress.getLocalHost(), 0))
|
||||||
|
|
||||||
val lock = Object()
|
val lock = Object()
|
||||||
var done = false
|
var done = false
|
||||||
@ -281,4 +285,4 @@ class X509UtilitiesTest {
|
|||||||
serverSocket.close()
|
serverSocket.close()
|
||||||
assertTrue(done)
|
assertTrue(done)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user