Code Monkey home page Code Monkey logo

Comments (2)

korylprince avatar korylprince commented on July 18, 2024

This is an issue with your code, not this library.
TL;DR: You need to use replace Server: "X.X.X.X", with Server: "<server hostname>",, most likely.

The error is telling you that your client can't verify the server's certificate because you've provided an IP and that IP is not in the certificate. That's how TLS verification works. It's going to verify the IP or hostname you've given it

It's the same reason you'll get an error in your browser when connecting to https://216.58.194.100/ instead of https://www.google.com/; The certificate for www.google.com doesn't list all the IPs it uses, it just lists www.google.com (and a few other domains.)

To fix this, you need to make sure your server has a certificate that's from a trusted CN. This could be one you purchased, a free one from LetsEncrypt, or possibly one you created (i.e. self-signed). In that last case, you'll need to make sure that the CN certificate you created is trusted on the client, or you'll get get another error.

Then in your client, connect with the hostname listed in the certificate (you'll need to make sure that hostname points to the correct server in your DNS.) The hostname will be checked to make sure it's in the cert, and the cert's CN will be checked to make sure it's trusted. If both of those things are correct, a secure, verified connection will be started.

If you can't provide those two things (a trusted CN and a certificate with the hostname in in it) then you'll have to use InsecureSkipVerify: true and be vulnerable to MitM attacks.

from go-ad-auth.

faurik avatar faurik commented on July 18, 2024

Thanks for the advice, replacing the IP with the hostname solved my problem.

from go-ad-auth.

Related Issues (13)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.