Github Package Registry Certificate Mismatch for Gradle

Hi I am setting up a new development environment with ubuntu 20.04 and I am getting the following error after setting up the project and token information. I couldn’t find any information online so I am posting this topic here in case anyone can help or did encounter this problem before. Thank you.

Execution failed for task ':commons:compileJava'.
> Could not resolve all files for configuration ':commons:compileClasspath'.
   > Could not resolve com.aaa:aaa:1.0.0.
     Required by:
         project :commons
      > Could not resolve com.aaa:aaa:1.0.0.
               > Certificate for <maven.pkg.github.com> doesn't match any of the subject alternative names: [*.registry.github.com, registry.github.com]

I’m hitting the same problem;

Could not resolve io.firefly:firefly-gradle-conventions:0.2.1.
     Required by:
         project : > io.firefly.project-convention:io.firefly.project-convention.gradle.plugin:0.2.1
      > Could not resolve io.firefly:firefly-gradle-conventions:0.2.1.
         > Could not get resource 'https://maven.pkg.github.com/sebeard/firefly-gradle-conventions/io/firefly/firefly-gradle-conventions/0.2.1/firefly-gradle-conventions-0.2.1.pom'.
            > Could not GET 'https://maven.pkg.github.com/sebeard/firefly-gradle-conventions/io/firefly/firefly-gradle-conventions/0.2.1/firefly-gradle-conventions-0.2.1.pom'.
               > Certificate for <maven.pkg.github.com> doesn't match any of the subject alternative names: [*.registry.github.com, registry.github.com]