Jinterface question

Richard Carlsson richardc@REDACTED
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) foo@REDACTED
<- PORT 55098
-> MD5 CONNECT TO harpo.it.uu.se:55098
-> HANDSHAKE sendName flags=4 dist=5 local=pp_client@REDACTED
<- HANDSHAKE recvStatus (ok) local=pp_client@REDACTED
<- HANDSHAKE recvChallenge from=foo@REDACTED challenge=218089577
local=pp_client@REDACTED
-> HANDSHAKE sendChallengeReply challenge=-437147855
digest=283f393f3f3f3f683f73304a3f3f3157 local=pp_client@REDACTED
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 'pp_client@REDACTED' ** 

(foo@REDACTED)1> erlang:get_cookie().
'GNGHONVCOKHWGENSXJFF'
(foo@REDACTED)2> auth:get_cookie('pp_client@REDACTED').
'GNGHONVCOKHWGENSXJFF'
(foo@REDACTED)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)
(bar@REDACTED)1> erlang:get_cookie().
'LCGCVEJOKLRRXDWZOIZY'
(bar@REDACTED)2> auth:get_cookie('foo@REDACTED').
'LCGCVEJOKLRRXDWZOIZY'
(bar@REDACTED)3> net_adm:ping('foo@REDACTED').
pang
(bar@REDACTED)4> erlang:set_cookie('foo@REDACTED',
'GNGHONVCOKHWGENSXJFF').
true
(bar@REDACTED)5> net_adm:ping('foo@REDACTED').
pong   
(bar@REDACTED)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 'bar@REDACTED' ** 

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 (richardc@REDACTED)   (This space intentionally left blank.)
E-mail: Richard.Carlsson@REDACTED	WWW: http://www.csd.uu.se/~richardc/




More information about the erlang-questions mailing list