ManageIQ / manageiq-appliance_console

The console for the ManageIQ appliances.
Apache License 2.0
2 stars 28 forks source link

Unable to fetch key from remote system, fails with `dh#set_pqg= is incompatible with OpenSSL 3.0` #245

Closed agrare closed 6 months ago

agrare commented 6 months ago
[root@manageiq-1 ~]# appliance_console_cli --fetch-key manageiq-0.localdomain --sshlogin root --sshpassword smartvm
fetch encryption key
Failed to fetch key: dh#set_pqg= is incompatible with OpenSSL 3.0
Could not create encryption key (v2_key)
Configure Application

No encryption key found.
For migrations, copy encryption key from a hardened appliance.
For worker and multi-region setups, copy key from another appliance.
If this is your first appliance, just generate one now.

Encryption Key

1) Create key
2) Fetch key from remote machine
(1) 
Choose the encryption key: |1| 2

Enter the hostname for appliance with encryption key: manageiq-0.localdomain
Enter the appliance SSH login: |root|
Enter the appliance SSH password: *******
Enter the path of remote encryption key: |/var/www/miq/vmdb/certs/v2_key|
Failed to fetch key: dh#set_pqg= is incompatible with OpenSSL 3.0/v2_key
Try again? (Y/N)

Backtrace:

"/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/buffer.rb:276:in `set_key'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/buffer.rb:276:in `read_keyblob'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/buffer.rb:248:in `read_key'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:154:in `block (2 levels) in keys_for'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:136:in `each_line'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:136:in `block in keys_for'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:134:in `open'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:134:in `keys_for'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:64:in `block in search_in'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:64:in `map'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:64:in `search_in'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/known_hosts.rb:58:in `search_for'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/transport/session.rb:96:in `host_keys'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/transport/algorithms.rb:230:in `prepare_preferred_algorithms!'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/transport/algorithms.rb:119:in `initialize'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/transport/session.rb:86:in `new'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh/transport/session.rb:86:in `initialize'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh.rb:237:in `new'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-ssh-4.2.0/lib/net/ssh.rb:237:in `start'",
 "/home/grare/adam/.gem/ruby/3.1.0/gems/net-scp-1.2.1/lib/net/scp.rb:202:in `start'",
 "/home/grare/adam/src/manageiq/manageiq-appliance_console/lib/manageiq/appliance_console/key_configuration.rb:104:in `fetch_key'",
 "/home/grare/adam/src/manageiq/manageiq-appliance_console/lib/manageiq/appliance_console/key_configuration.rb:122:in `get_new_key'",
 "/home/grare/adam/src/manageiq/manageiq-appliance_console/lib/manageiq/appliance_console/key_configuration.rb:55:in `activate'",
 "/home/grare/adam/src/manageiq/manageiq-appliance_console/lib/manageiq/appliance_console/cli.rb:405:in `create_key'",
 "/home/grare/adam/src/manageiq/manageiq-appliance_console/lib/manageiq/appliance_console/cli.rb:260:in `run'",
 "/home/grare/adam/src/manageiq/manageiq-appliance_console/lib/manageiq/appliance_console/cli.rb:540:in `parse'
agrare commented 6 months ago

NOTE the same failure is seen when fetching the kafka /opt/kafka/config/keystore/truststore.jks:

[root@manageiq-1 ~]# appliance_console_cli --hostname manageiq-0.localdomain --password smartvm --message-client-config --message-server-host manageiq-0.localdomain --message-server-password smartvm --server start
configuring external database
Configure Messaging Yaml
Create Client Properties
Fetch Truststore From Server
Failed to fetch /opt/kafka/config/keystore/truststore.jks from server: dh#set_pqg= is incompatible with OpenSSL 3.0
Cannot start Translation missing: en.product.name: Messaging has not been configured.
agrare commented 6 months ago

Believe this is resolved by net-ssh 7.0.0 https://github.com/net-ssh/net-ssh/pull/864

kbrock commented 6 months ago

ASIDE: There is the option to use scp instead of writing this ourselves.