4

I generated a golang server with go-swagger. I set the scheme to https (and only https). When I startup my server I get a TLS error.

the required flags `--tls-certificate` and `--tls-key` were not specified

It is clear that I haven't properly set my TLS flags but I really don't know the best way to to do this in go with go-swagger.

Anyone have any experience setting up TLS with go-swagger as I couldn't find any good links?

Thank you.

mornindew
  • 1,993
  • 6
  • 32
  • 54

1 Answers1

3

When you get certificates you get a private key file and a public key (certificate) file.

Here's an example of how they are used: https://github.com/go-swagger/go-swagger/tree/master/examples/todo-list#run-full-server

./todo-list-server --tls-certificate mycert1.crt --tls-key mycert1.key

Casual Jim
  • 1,179
  • 7
  • 13
  • Thank you, you were right. It was getting lost when I built my docker file. I set it in my build and passed it in. Worked great. – mornindew Jul 12 '18 at 23:22