Unable to backup to custom s3 endpoint due to https certificate error

I have the same issue. Tried to setup backups to my minio. Got the same error.

Endpoint looks like s3.k8s.domain.com. domain.com and s3.k8s.domain.com does have valid certificates issued by LE. k8s.domain.com does not have certificate.

How to solve this problem?