{"action":"opened","issue":{"url":"https://api.github.com/repos/zalando/skipper/issues/621","repository_url":"https://api.github.com/repos/zalando/skipper","labels_url":"https://api.github.com/repos/zalando/skipper/issues/621/labels{/name}","comments_url":"https://api.github.com/repos/zalando/skipper/issues/621/comments","events_url":"https://api.github.com/repos/zalando/skipper/issues/621/events","html_url":"https://github.com/zalando/skipper/issues/621","id":314603279,"number":621,"title":"Allow multiple certificates / keys","user":{"login":"vetinari","id":53407,"avatar_url":"https://avatars1.githubusercontent.com/u/53407?v=4","gravatar_id":"","url":"https://api.github.com/users/vetinari","html_url":"https://github.com/vetinari","followers_url":"https://api.github.com/users/vetinari/followers","following_url":"https://api.github.com/users/vetinari/following{/other_user}","gists_url":"https://api.github.com/users/vetinari/gists{/gist_id}","starred_url":"https://api.github.com/users/vetinari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vetinari/subscriptions","organizations_url":"https://api.github.com/users/vetinari/orgs","repos_url":"https://api.github.com/users/vetinari/repos","events_url":"https://api.github.com/users/vetinari/events{/privacy}","received_events_url":"https://api.github.com/users/vetinari/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-16T11:07:26Z","updated_at":"2018-04-16T11:07:26Z","closed_at":null,"author_association":"MEMBER","body":"When using skipper as entry point it would be nice to have multiple certificates. Go supports SNI on TLS enabled Servers. POC:\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n\t\"os\"\r\n\t\"fmt\"\r\n\t\"net/http\"\r\n\t\"strings\"\r\n\t\"log\"\r\n\t\"crypto/tls\"\r\n)\r\n\r\nfunc main() {\r\n\tcerts := strings.Split(os.Args[1], \",\")\r\n\tkeys := strings.Split(os.Args[2], \",\")\r\n\r\n\tcfg := &tls.Config{}\r\n\tfor i, cert := range certs {\r\n\t\tkp, err := tls.LoadX509KeyPair(cert, keys[i])\r\n\t\tif err != nil {\r\n\t\t\tlog.Fatalf(\"Failed to load key %s: %s\", cert, err)\r\n\t\t}\r\n\t\tcfg.Certificates = append(cfg.Certificates, kp)\r\n\t}\r\n\tcfg.BuildNameToCertificate()\r\n\r\n\thttp.HandleFunc(\"/\", func(w http.ResponseWriter, r *http.Request) {\r\n\t\tfmt.Fprintf(w, \"Host: %s, TLS.ServerName: %s\\n\", r.Host, r.TLS.ServerName)\r\n\t})\r\n\tsrv := &http.Server{\r\n\t\tAddr: \":8081\",\r\n\t\tTLSConfig: cfg,\r\n\t}\r\n\tlog.Fatalf(\"%s\", srv.ListenAndServeTLS(\"\",\"\"))\r\n}\r\n```\r\n\r\nGenerate cert/keys with\r\n```\r\ngo run $GOROOT/src/crypto/tls/generate_cert.go -host host1.local -ca\r\nmv cert.pem host1.crt.pem\r\nmv key.pem host1.key.pem\r\ngo run $GOROOT/src/crypto/tls/generate_cert.go -host host2.local -ca\r\n```\r\n\r\nedit /etc/hosts to set host1.local and host2.local as alias for 127.0.0.1  and run with `go run server.go host1.key.pem,cert.pem host1.key.pem,key.pem` and use `curl -v https://host1.local:8081/ --cacert host1.crt.pem --http2` and `curl -v https://host2.local:8081/ --cacert cert.pem --http2`\r\n"}}
{"actor":{"display_login":"vetinari"}}