I2P SAM: Unsupported encryption options

I2P router issues
Post Reply
anikey
Posts: 22
Joined: 30 Nov 2023 20:08

I2P SAM: Unsupported encryption options

Post by anikey »

Hi.

When an application tries to connect to some destinations via SAM (on Java router), it can't do that, because it errors out with CANT_REACH_PEER and "Unsupported encryption options". However, that destination can be contacted with other means (HTTP proxy, I2PSnark works too).

The follwing destination does not appear to be contactable over SAM: tracker2.postman.i2p

However, SAM still works for other destinations, for example: i2p-projekt.i2p

As a consequence of this uncontactability, some software may be unable to work in i2p. More concretely, i am talking about qBittorrent, which recently gained I2P support via SAM, but it can't contact tracker2.postman.i2p to announce itself. However, this problem does not appear to be specific to qBittorrent, because it still can be reproduced when testing with netcat (manually typing SAM protocol commands).

How is it possible to fix this problem?

P.S. i2pd seems to have a similar problem, but instead of erroring out, it just waits for a long time and then times out. I have posted that problem on the i2pd subforum earlier.

Edit: I have noticed (in router console leaseset lookup) that tracker2.postman.i2p has only ECIES_X25519 encryption key, while i2p-projekt.i2p has both ECIES_X25519 and ELGAMAL_2048 encryption keys listed. Is that related to the problem? Could it be that I2P SAM cannot connect to ECIES-only destinations?

Edit2: After some more digging, i have discovered that the error probably comes from

Code: Select all

router/java/src/net/i2p/router/message/OutboundClientMessageOneShotJob.java
In this file it says that:

Code: Select all

        if (_to.getEncType() != EncType.ELGAMAL_2048) {
            // Enc type in key cert, proposal 145, unsupported
            dieFatal(MessageStatusMessage.STATUS_SEND_FAILURE_UNSUPPORTED_ENCRYPTION);
            return;
        }
So, i'm guessing that I2P java does not support non-ELGAMAL encryption? But then how can it connect through other ways (HTTP proxy, i2p snark)? And most importantly, will non-elgamal become supported in SAM? (Please note that i'm not complaining, i am just noticing things).
anikey
Posts: 22
Joined: 30 Nov 2023 20:08

Re: I2P SAM: Unsupported encryption options

Post by anikey »

Resolved!!
Thanks for helping, this is what it came down to:

You need to add 'i2cp.leaseSetEncType=4,0' to the SAM session create options!!

See discussion on github: https://github.com/qbittorrent/qBittorrent/issues/19625
Post Reply