diamondburned / gotktrix

Matrix client in Go and GTK4
GNU Affero General Public License v3.0
313 stars 7 forks source link

Self-signed certificates containing IP is not possible to use #29

Open kevit opened 2 years ago

kevit commented 2 years ago

Hi, I use for the labs particular setup with self-signed certs. Might it be possible to allow certificates which cannot be validated

Error! fetching discovery info: Get "https://192.168.122.27/.well-known/matrix/client": x509: cannot validate certificate for 192.168.122.27 because it doesn't contain any IP SANs

diamondburned commented 2 years ago

I'm not too sure what I can do about this. You might have to look into how Go's net/http handle this.

daenney commented 2 years ago

The error message isn't so much that the certificate can't be validated due to its self-signed nature, but that it does not contain any IP addresses in the subjectAltNames. It's probably only set in the commonName, which isn't correct.

There's a blog post over here which shows how to do that with OpenSSL.