ODBC Driver 18 for SQL Server SSL Provider

Recently upgraded php7 to php8 and updated apache version. All PHP scripts connecting to sql server now throwing following error:

Array ( [0] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => -2146893019 [code] => -2146893019 [2] => [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: The certificate chain was issued by an authority that is not trusted. [message] => [Microsoft][ODBC Driver 18 for SQL Server]SSL Provider: The certificate chain was issued by an authority that is not trusted. ) [1] => Array ( [0] => 08001 [SQLSTATE] => 08001 [1] => -2146893019 [code] => -2146893019 [2] => [Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish connection [message] => [Microsoft][ODBC Driver 18 for SQL Server]Client unable to establish connection ) )

ODBC driver is already installed. Any suggestion will be appreciated.

I Tried to reinstall ODBC driver to latest version but no results so far.