Alpine static compiled binary failed with Routines:tls_process_server_certificate:certificate verify failed (OpenSSL::SSL::Error) when run it on CentOS 8

The OpenSSL library expects a certain system configuration (such as the location where certificates are looked up), which differs between Linux distributions. When linked statically, the resulting binary expects the system configuration used at compile time (i.e. Alpine linux’s). That same library won’t work on CentOS because it uses a different configuration.

This is a well-known problem which restricts the portability of statically linked OpenSSL libraries, so there are lots of resources on the web.

There are some workarounds. For example, you could use a statically linked library from the target system or build it on the host system but with the configuration for the target system.
Alternatively, it should be possible to change the configuration at runtime, either explicitly or with some automatic path lookup (like GitHub - alexcrichton/openssl-probe does for example).
Or avoid linking OpenSSL statically. The dynamic system library should always be configured to integrate well with the target system.