Connect API between go-libp2p & jvm-libp2p returns error


I am trying to establish connection between a go-libp2p host and another jvm-libp2p host. When I use the host.connect() API from the go-libp2p node by passing the multiaddress and peerID of the jvm-libp2p node, it returns an error : “failed to negotiate security protocol: protocol not supported”.

Any help on resolution of the above error would be appreciated!

I tried implementing noise on both sides and then tried using the connect API. It still gives the same error: “failed to negotiate security protocol: protocol not supported”.

Code snippet on jvm-libp2p side:
PrivKey key = generateKeyPair(KEY_TYPE.ED25519).component1();
Host host = new HostBuilder()
.protocol(new NoiseXXSecureChannel(key))

Code snippet on go-libp2p side:
_var options []libp2p.Option
priv, , err := crypto.GenerateEd25519Key(rand.Reader)
if err == nil {
options = append(options, libp2p.Identity(priv))
options = append(options, libp2p.Security(noise.ID, noise.New))
h, err := libp2p.New(options…)
h.Connect(ctx, *peerAddrInfo)
//peerAddrInfo contains info regarding the jvm-libp2p node

What is the probable mistake in the implementation?