Problem on URL redirection

Hello everyone,

I want to redirect following domains but I am getting security alert on it the HTTPS one. ---->                      [WORKS] ---->     [WORKS] ---->      [WORKS, but with security warning] -->     [WORKS] -->  [WORKS, but with security warning]

My config is as follows.

# CC Redirect
acl host_cc hdr(host) -i
acl host_cc hdr_beg(host) -i www.
reqirep ^Host:\ www.(.*)$ Host:\ \1 if host_ff
http-request redirect code 301 location if host_cc

Can you please help me with the config and tell me how can I fix this security warning alerts?
Thank you

Can start by saying what the security warning actually says?

Thanks for replying @lukastribus!

Your connection is not private
Attackers might be trying to steal your information from (for example, passwords, messages, or credit cards). Learn more
This server could not prove that it is; its security certificate is from * This may be caused by a misconfiguration or an attacker intercepting your connection.

You don’t have the correct certificate.

Thanks @lukastribus
Any idea on how I can pass the certificate while redirection? Before redirection certificate, does not have any issue and it was working fine.

Also, any recommendation on my rules to make them more optimised?

The certificate needs to be valid for all hostnames you are using. If you a redirecting to a hostname that is not covered by the certificate, you will see that error.

Thank you @lukastribus