Skip to content

Can't log in to SourceGraph with self-signed certificate

Created by: JohnAZoidberg

I set Sourcegraph up with a self-signed certificate, as described here: https://docs.sourcegraph.com/admin/ssl_https_self_signed_cert_nginx

Now I try to log in with the src command but it won't accept it and I can't figure out a way to ignore it. Adding insecure to ~/.curlrc doesn't work.

daniel@daniel-virtual-machine:~$ src login https://15.1.1.1:7443
❌ Problem: Error communicating with https://15.1.1.1:7443: Post "https://15.1.1.1:7443/.api/graphql": x509: certificate signed by unknown authority

🛠  To fix: Create an access token at https://15.1.1.1:7443/user/settings/tokens, then set the following environment variables:

   SRC_ENDPOINT=https://15.1.1.1:7443
   SRC_ACCESS_TOKEN=(the access token you just created)

   To verify that it's working, run this command again.

   (If you need to supply custom HTTP request headers, see information about SRC_HEADER_* env vars at https://github.com/sourcegraph/src-cli/blob/main/AUTH_PROXY.md.)

Should be easily doable like #239 but I don't feel like compiling Go programs at the moment.