将自签名SSL与http一起使用。在MacOS上进入golang

I didn't found right solution, so just, call an URL from golang on MacOS Sierra, to a server that uses self-signed SSL certificate.

I try to run a program that uses https://github.com/olivere/elastic that does the http query, so I don't have "control" on code-source really.

I am looking for a solution such as:

  • Disable SSL check for go by setting a bash variable (export GOLANG_SSL=false ?)
  • Set self-signed certif to golang

Or any other idea is welcomed!

Merci,

You should install (trust) the self-signed certificate in the host OS that runs the Go client.

There is no "Set self-signed certif to golang", but "Set self-signed certif to OS".

As for how to do that, it will depend on which OS you're running on the client machine, but a quick Google search can help you with that: install self-signed certificate in Windows/Linux/MacOS/FreeBSD/etc...