To lock the version of a package, you can use versionlock.

yum versionlock add openssl

Or with dnf:

dnf versionlock add openssl

To see the list of locked packages:

yum versionlock list

or with dnf:

dnf versionlock list

To remove a package from the list:

yum versionlock delete openssl

or with dnf:

dnf versionlock delete openssl