When I want to access the server, I get the following error:
'500 Internal Server Error' caused by: x509: cannot validate certificate for 10.0.7.237 because it doesn't contain any IP SANs"
If I add the following code to static configuration the error goes away and everything works fine:
serversTransport:
insecureSkipVerify: true
I read the documentation about insecureSkipVerify but it is very short and doesn't describe it in detail. I have 3 questions:
What exactly does insecureSkipVerify do?
Is it safe to set it to true in production environment with sensitive user data (passwords)?
Is there any way to not use insecureSkipVerify but get it working? I read about TCP routers which allow passthrough, but then I would have to use TCP service as well. I have to support sticky sessions. It seems to me that TCP services don't support them.
Disables SSL certificate verification between your traefik instance and your backend.
This means that your certificate does not need to be a valid one.
You can safely use this configuration in production, the fact that the certificate is not valid on your internal network is not a security concern, you flow will still be encrypted.
You can set insecureSkipVerify to false and bring the ca certificate to traefik, this way traefik can validate the certificate :
rootCAs is the list of certificates (as file paths, or data bytes) that will be set as Root Certificate Authorities when using a self-signed TLS certificate.
I am not using self-signed certificate. Does this still apply for certificates that are not self-signed? Do we need to provide path to certificate inside container?
Traefik <=> client connection is already secured (HTTPS). I want to secure Traefik <=> server(s) so I think my approach is correct. I just don't understand why it still throws the error below even if I specified rootCA.
'500 Internal Server Error' caused by: x509: cannot validate certificate for 10.0.7.237 because it doesn't contain any IP SANs"
When you created your self signed certificate have you fill this part : CN=something.com
Sorry for my missunderstanding of your problem..
I think it comes from your certificate, the insecureSkipVerify: true configuration should validate all self signed certificate
I don't understand what you mean by that. I want to use my certificate for Traefik <=> servers communication as well, I don't want to allow insecure communication. I noticed the following:
If I addinsecureSkipVerify: true and removerootCAs section -> WORKS
If I addinsecureSkipVerify: true and keeprootCAs section -> ERROR
If I removeinsecureSkipVerify: true and keeprootCAs section -> ERROR
If I removeinsecureSkipVerify: true and removerootCAs section -> ERROR
The case 1 is working as intended with your configuration.
(the case 3 should work too.. that is the part that i don't understand.. !)
I'll have to run some tests and will write down the results here.
But if you go with the case 1, i think there is no security concern, and all communications will be encrypted. There is no need for the internal certificate to be a valid one, if i understand your concern : you just want the internal communications to be encrypted.
I have the same issue... need to use insecureskipverify=true
I am using kubernetes-CRD and I can't find an example configuration - so if anyone has gotten this to work with self-signed (private CA) CRTs - I'd love an exchange
@aleksvujic Just a thought, but do you have the full certificate chain configured on your load balancers?
My interpretation of the insecureSkipVerify setting is to ignore SSL/TLS validations between Traefik and backend servers (in your case the load balancers).
Additionally, my understanding of the rootCAs setting is that it only applies to self-signed certificates.
So it would seem that Traefik is finding the certificate presented on the load balancer service to be invalid, possibly because the certificate there is invalid or the full chain isn't present on that service.
You could try to install the intermediate / root certificates on the load balancer, or if you are using PEM format, to include the intermediate/root certs below the existing server cert.
Update: I almost forgot, the error about IP SANs makes me wonder if Traefik is connecting to the backend server by IP address instead of DNS name (which should match the certificate domains). Not sure if Traefik can even use DNS for backend services
I have thought of this as well. Can somebody from the Traefik team clarify how Traefik addresses servers? Does it use IP address or host name? If it uses IP address, then the error is obvious. Can we force Traefik to address servers by hostname?
@aleksvujic I think there is some confusion in regrads to two separate communctions:
Browser <==> traefik
Traefik <==> your app
We are talking about number 2, right? Did you bake the certificates into your application image, along with private keys? I do not see you mounting them in a volume in your config.
@zespri Yes, we are talking about number 2. Containers have a directory with necessary certificates mounted, I skipped it in my initial post to keep it as simple as possible.
We have a .NET Core app and we provided the certificate information in docker-compose file like so:
With this configuration, containers are able to accept HTTPS requests, but only if I use insecureSkipVerify. But I am not sure why I have to use this flag.