Jinterface question

Richard Carlsson <>
Wed Feb 23 10:29:38 CET 2000



On 22 Feb 2000, Gordon Beaton wrote:

> On 22 Feb 2000 18:16:16 GMT, Richard Carlsson wrote:
> > > 	java -DOtpConnection.trace=4 MyClass ...
> > 
> > Did that. Even inserted some print statements in the Java code and
> > recompiled to see what was going on.
> 
> Perhaps you could post the trace output so we can see what is going
> on too?

Here it is. The printout of "self.cookie() ->" is my own addition,
done just before the exception is thrown

-> LOOKUP (r4) 
<- PORT 55098
-> MD5 CONNECT TO harpo.it.uu.se:55098
-> HANDSHAKE sendName flags=4 dist=5 local=
<- HANDSHAKE recvStatus (ok) local=
<- HANDSHAKE recvChallenge from= challenge=218089577
local=
-> HANDSHAKE sendChallengeReply challenge=-437147855
digest=283f393f3f3f3f683f73304a3f3f3157 local=
self.cookie() -> GNGHONVCOKHWGENSXJFF
com.ericsson.otp.erlang.OtpAuthException: Peer authentication error.

--------

An on the Erlang side:

=ERROR REPORT==== 23-Feb-2000::10:15:59 ===
** Connection attempt from disallowed node '' ** 

()1> erlang:get_cookie().
'GNGHONVCOKHWGENSXJFF'
()2> auth:get_cookie('').
'GNGHONVCOKHWGENSXJFF'
()1>

--------

Just to check that it is at all possible to connect to that node,
I start another Erlang node, initially using a different cookie:

Erlang (BEAM) emulator version 4.9.1 [source]

Eshell V4.9.1  (abort with ^G)
()1> erlang:get_cookie().
'LCGCVEJOKLRRXDWZOIZY'
()2> auth:get_cookie('').
'LCGCVEJOKLRRXDWZOIZY'
()3> net_adm:ping('').
pang
()4> erlang:set_cookie('',
'GNGHONVCOKHWGENSXJFF').
true
()5> net_adm:ping('').
pong   
()6> 

At the first `ping' attempt, the original node responded just like in the
Java case:

=ERROR REPORT==== 23-Feb-2000::10:20:22 ===
** Connection attempt from disallowed node '' ** 

but after I manually set the cookie, the connection worked just fine,
so that Jinterface cannot connect appears rather strange.

--------

One thing in OtpConnection.java that I could not help but notice:

  // This is nooo good as a challenge,
  // XXX fix me.
  static private int genChallenge() {
    return random.nextInt();
  }

although whether it can be the source of this error, I can't tell.

	/Richard Carlsson


Richard Carlsson ()   (This space intentionally left blank.)
E-mail: 	WWW: http://www.csd.uu.se/~richardc/




More information about the erlang-questions mailing list