You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The --key option of mqtt-cli should recognize 4096-bit RSA private key files with just a private key in them.
Actual behavior
The --key option of mqtt-cli does not recognize 4096-bit RSA private keys with just a private key in them.
To Reproduce
I cannot provide my private key, but I have confirmed it works correctly with other mqtt clients that support client certificates. Here are some commands that will communicate what is going on:
> openssl rsa -text -noout -in app.key
RSA Private-Key: (4096 bit, 2 primes)
modulus:
...
> mqtt sub -t '$my/topic/name' -h example.com -p 443 --cafile AmazonRootCA1.pem --key app.key --cert app.pem
Invalid value for option '--key': cannot convert '/etc/mqtt_status/certs/probation.key' to PrivateKey (The private key could not be recognized.)
The source code in FileToPrivateKeyConverter suggests that the application is making it all the way down to where UNRECOGNIZED_KEY gets thrown. This means that the key is being parsed correctly (it isn't malformed), but it is not an instanceof either PKCS8EncryptedPrivateKeyInfo or PEMKeyPair. I'm not sure what it is an instanceof though. I'm not familiar with Java's crypto ecosystem.
Details
Version info from mqtt client:
> mqtt --version
1.1.1
Picocli 4.0.4
JVM: 11.0.5 (Private Build OpenJDK 64-Bit Server VM 11.0.5+10-post-Ubuntu-0ubuntu1.118.04)
OS: Linux 4.15.0-65-generic amd64
The text was updated successfully, but these errors were encountered:
Expected behavior
The
--key
option ofmqtt-cli
should recognize 4096-bit RSA private key files with just a private key in them.Actual behavior
The
--key
option ofmqtt-cli
does not recognize 4096-bit RSA private keys with just a private key in them.To Reproduce
I cannot provide my private key, but I have confirmed it works correctly with other mqtt clients that support client certificates. Here are some commands that will communicate what is going on:
The source code in
FileToPrivateKeyConverter
suggests that the application is making it all the way down to whereUNRECOGNIZED_KEY
gets thrown. This means that the key is being parsed correctly (it isn't malformed), but it is not aninstanceof
eitherPKCS8EncryptedPrivateKeyInfo
orPEMKeyPair
. I'm not sure what it is aninstanceof
though. I'm not familiar with Java's crypto ecosystem.Details
Version info from
mqtt
client:The text was updated successfully, but these errors were encountered: