Full ubuntu 20.04 support - cli_wallet & openSSL #413

Closed
opened 2022-08-05 19:46:25 +00:00 by rilesdun · 15 comments
rilesdun commented 2022-08-05 19:46:25 +00:00 (Migrated from gitlab.com)

By default, Ubuntu 20.04 is not using openSSL 1.0 anymore - It is using v1.2, if we are offering full Ubuntu 20.04 support we must upgrade OpenSSL to work on 20.04 by default. The following error is outputted upon trying to connect to a running testnet - Note: The testnet is also running on 20.04

Logging RPC to file: logs/rpc/rpc.log
Starting a new wallet with chain ID 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 (from CLI)
0 exception: unspecified
TLS handshake failed
    {"message":"TLS handshake failed"}
    asio  websocket.cpp:436 operator()

    {"uri":"wss://mint.peerplays.download/api"}
    th_a  websocket.cpp:662 secure_connect

    {"uri":"wss://mint.peerplays.download/api"}
    th_a  websocket.cpp:635 connect

There is a workaround for 20.04 here with the following two sed commands:

sed -i '/^oid_section.*/a openssl_conf=default_conf' /etc/ssl/openssl.cnf

and

sed -i '/^ess_cert_id_alg.*/a\[default_conf]\nssl_conf=ssl_sect\n[ssl_sect]\nsystem_default=system_default_sect\n[system_default_sect]\nMinProtocol=TLSv1\nCipherString=DEFAULT@SECLEVEL=1' /etc/ssl/openssl.cnf

This forces 20.04 to have 1.0 support, but is not explained in the readme - As well as downgrading OpenSSL at the OS level is not recommended.

This is reproducible via the following:

  • Install fresh Ubuntu 20.04, update completely.
  • Install the dependencies for compiling to ensure not dependencies are missing
  • Build or clone master OR develop branch
  • Try connecting to a remote testnet node using the cli_wallet over secured websocket (WSS)

Example command for connecting from a remote system:

./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014

By default, Ubuntu 20.04 is not using openSSL 1.0 anymore - It is using v1.2, if we are offering full Ubuntu 20.04 support we must upgrade OpenSSL to work on 20.04 by default. The following error is outputted upon trying to connect to a running testnet - Note: The testnet is also running on 20.04 ``` Logging RPC to file: logs/rpc/rpc.log Starting a new wallet with chain ID 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 (from CLI) 0 exception: unspecified TLS handshake failed {"message":"TLS handshake failed"} asio websocket.cpp:436 operator() {"uri":"wss://mint.peerplays.download/api"} th_a websocket.cpp:662 secure_connect {"uri":"wss://mint.peerplays.download/api"} th_a websocket.cpp:635 connect ``` There is a workaround for 20.04 here with the following two sed commands: `sed -i '/^oid_section.*/a openssl_conf=default_conf' /etc/ssl/openssl.cnf` and ``` sed -i '/^ess_cert_id_alg.*/a\[default_conf]\nssl_conf=ssl_sect\n[ssl_sect]\nsystem_default=system_default_sect\n[system_default_sect]\nMinProtocol=TLSv1\nCipherString=DEFAULT@SECLEVEL=1' /etc/ssl/openssl.cnf ``` This forces 20.04 to have 1.0 support, but is not explained in the readme - As well as downgrading OpenSSL at the OS level is not recommended. This is reproducible via the following: - Install fresh Ubuntu 20.04, update completely. - Install the dependencies for compiling to ensure not dependencies are missing - Build or clone master OR develop branch - Try connecting to a remote testnet node using the cli_wallet over secured websocket (WSS) Example command for connecting from a remote system: `./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014`
rilesdun commented 2022-08-05 19:46:25 +00:00 (Migrated from gitlab.com)

assigned to @serkixenos

assigned to @serkixenos
rilesdun commented 2022-08-05 20:41:38 +00:00 (Migrated from gitlab.com)

changed the description

changed the description
serkixenos commented 2022-08-21 22:59:49 +00:00 (Migrated from gitlab.com)
Looks like intentionally disabled: https://gitlab.com/PBSA/tools-libs/peerplays-fc/-/blob/156b0c4e41c9215eadb2af8009b05e0f38c16dda/src/network/http/websocket.cpp#L305 https://gitlab.com/PBSA/tools-libs/peerplays-fc/-/blob/156b0c4e41c9215eadb2af8009b05e0f38c16dda/src/network/http/websocket.cpp#L498
rilesdun commented 2022-08-22 13:46:16 +00:00 (Migrated from gitlab.com)

This is only disabling v2 and v3 - Ubuntu 20.04 is using v1.2 compared to 1.0 on 18.04..

This is only disabling v2 and v3 - Ubuntu 20.04 is using v1.2 compared to 1.0 on 18.04..
serkixenos commented 2022-08-23 01:40:30 +00:00 (Migrated from gitlab.com)

marked this issue as related to #370

marked this issue as related to #370
mkhan17 commented 2022-09-09 09:34:32 +00:00 (Migrated from gitlab.com)
works on Ubuntu 20.04 with this fix https://gitlab.com/PBSA/tools-libs/peerplays-fc/-/merge_requests/30
mkhan17 commented 2022-09-09 09:35:09 +00:00 (Migrated from gitlab.com)

assigned to @mkhan17

assigned to @mkhan17
mkhan17 commented 2022-09-09 09:55:30 +00:00 (Migrated from gitlab.com)
meheboob@meheboob-GF63-Thin-9SCSR:~/peerplays23/peerplays/programs/cli_wallet$ ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014
Logging RPC to file: logs/rpc/rpc.log
Starting a new wallet with chain ID 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 (from CLI)
237279ms th_a       main.cpp:198                  main                 ] wdata.ws_user:  wdata.ws_password:  
Please use the set_password method to initialize a new wallet before continuing
new >>> set_password ps
set_password ps
null
locked >>> unlock ps
unlock ps
null
unlocked >>> 
<pre><font color="#4E9A06"><b>meheboob@meheboob-GF63-Thin-9SCSR</b></font>:<font color="#3465A4"><b>~/peerplays23/peerplays/programs/cli_wallet</b></font>$ ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 Logging RPC to file: logs/rpc/rpc.log Starting a new wallet with chain ID 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 (from CLI) 237279ms th_a main.cpp:198 main ] wdata.ws_user: wdata.ws_password: Please use the set_password method to initialize a new wallet before continuing new &gt;&gt;&gt; set_password ps set_password ps null locked &gt;&gt;&gt; unlock ps unlock ps null unlocked &gt;&gt;&gt; </pre>
mkhan17 commented 2022-09-12 12:35:23 +00:00 (Migrated from gitlab.com)

Test instructions:

  1. Install Ubuntu 20.04 (if its already Ubuntu 20.04 there is no need for fresh installation)

  2. Follow below steps

git clone https://gitlab.com/PBSA/peerplays.git

cd peerplays

git submodule update --init --recursive

  1. Build the code for test net

cd to /peerplays/programs/cli_wallet/

and run ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 Logging RPC to file: logs/rpc/rpc.log

NOTE: You will face error as described as the original issue in this ticket

Then

  1. replace the file /peerplays/libraries/fc/src/network/http/websocket.cpp with the file from this merge request https://gitlab.com/PBSA/tools-libs/peerplays-fc/-/merge_requests/30

  2. Build the code for test net

cd to /peerplays/programs/cli_wallet/

and run ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 Logging RPC to file: logs/rpc/rpc.log

you will see now the success logs as per the output from my previous comment

Test instructions: 1) Install Ubuntu 20.04 (if its already Ubuntu 20.04 there is no need for fresh installation) 2) Follow below steps git clone https://gitlab.com/PBSA/peerplays.git cd peerplays git submodule update --init --recursive 3) Build the code for test net cd to /peerplays/programs/cli_wallet/ and run ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 Logging RPC to file: logs/rpc/rpc.log NOTE: You will face error as described as the original issue in this ticket Then 4) replace the file /peerplays/libraries/fc/src/network/http/websocket.cpp with the file from this merge request https://gitlab.com/PBSA/tools-libs/peerplays-fc/-/merge_requests/30 5) Build the code for test net cd to /peerplays/programs/cli_wallet/ and run ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 Logging RPC to file: logs/rpc/rpc.log you will see now the success logs as per the output from my previous comment
serkixenos commented 2022-09-12 21:58:53 +00:00 (Migrated from gitlab.com)

assigned to @wsalloum

assigned to @wsalloum
serkixenos commented 2022-09-12 22:00:41 +00:00 (Migrated from gitlab.com)

@mkhan17 @wsalloum How does this work on 18.04?

@mkhan17 @wsalloum How does this work on 18.04?
wsalloum commented 2022-09-14 07:43:45 +00:00 (Migrated from gitlab.com)

It is working fine.

Test instructions on Ubuntu 18.04 :

  • git clone https://gitlab.com/PBSA/peerplays.git

  • cd peerplays

  • git submodule update --init --recursive

  • Build the code for test net

  • cd to /peerplays/programs/cli_wallet/

  • run ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014

bunker@waseem-1804:~/peerplays/programs/cli_wallet$ ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014
Logging RPC to file: logs/rpc/rpc.log
Starting a new wallet with chain ID 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 (from CLI)
746053ms th_a       main.cpp:198                  main                 ] wdata.ws_user:  wdata.ws_password:  
Please use the set_password method to initialize a new wallet before continuing
new >>> set_password password
set_password password
null
locked >>> unlock password
unlock password
null
It is working fine. Test instructions on Ubuntu 18.04 : - git clone https://gitlab.com/PBSA/peerplays.git - cd peerplays - git submodule update --init --recursive - Build the code for test net - cd to /peerplays/programs/cli_wallet/ - run `./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014` ``` bunker@waseem-1804:~/peerplays/programs/cli_wallet$ ./cli_wallet -s wss://mint.peerplays.download/api --chain-id 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 Logging RPC to file: logs/rpc/rpc.log Starting a new wallet with chain ID 2c25aae5835fd54020329d4f150b04867e72cbd8f7f7b900a7c3da8a329a6014 (from CLI) 746053ms th_a main.cpp:198 main ] wdata.ws_user: wdata.ws_password: Please use the set_password method to initialize a new wallet before continuing new >>> set_password password set_password password null locked >>> unlock password unlock password null
wsalloum (Migrated from gitlab.com) closed this issue 2022-09-14 15:18:34 +00:00
serkixenos commented 2022-10-10 23:42:15 +00:00 (Migrated from gitlab.com)

mentioned in issue #370

mentioned in issue #370
rilesdun commented 2023-02-17 18:50:47 +00:00 (Migrated from gitlab.com)

mentioned in issue #510

mentioned in issue #510
rilesdun commented 2023-02-27 15:41:36 +00:00 (Migrated from gitlab.com)

mentioned in issue #514

mentioned in issue #514
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Peerplays_Blockchain/peerplays_migrated#413
No description provided.