Somehow, I wanted to add some new Subject Alternative Names (SANs) to my k3s cluster but it didn't work (see https://dev.to/algo7/k3s-update-tls-sans-2kg3 if you wanna try).

But I didn't to blindly accept the connection without any TLS verification. So I found this little setting for the KubeConfig file :

apiVersion: v1
clusters:
- cluster:
    server: https://$IP:6443
    tls-server-name: $NAME
  name: default

By adding the tls-server-name, it's like adding a custom entry in /etc/hosts making TLS work by setting the SNI correctly.

Bye ~