(path string)
| 53 | } |
| 54 | |
| 55 | func getTLSConfig(path string) (t *tls.Config, err error) { |
| 56 | config := &tls.Config{} |
| 57 | if config.NextProtos == nil { |
| 58 | config.NextProtos = []string{"http/1.1"} |
| 59 | } |
| 60 | config.Certificates = make([]tls.Certificate, 1) |
| 61 | config.Certificates[0], err = tls.LoadX509KeyPair(path, path) |
| 62 | if err != nil { |
| 63 | return nil, err |
| 64 | } |
| 65 | return config, nil |
| 66 | } |
| 67 | |
| 68 | // This filthy hack works in conjunction with hostPortStrip to restore the |
| 69 | // original request host after mux match. |
no outgoing calls