My Opinion here would be the installation does not have a proper SSL library installed. When you try to connect to wordpress.org via SSL, you’re not presenting valid encryption “stuff”, so wordpress.org is rejecting the connection.
It’s not a WordPress issue. It’s your hosting that’s incorrectly set up.
Check once if you have openSSL libraries installed properly?
Also check this link if that helps.
No it was not due to ssl. I was getting the error because of older php version. Updated the php to 7.3 and now issue is resolved.
Good to know that you were able to fix the problem and thank you for sharing the solution.