tls.go 407 B

12345678910111213141516
  1. // Copyright (C) 2014 Jakob Borg and other contributors. All rights reserved.
  2. // Use of this source code is governed by an MIT-style license that can be
  3. // found in the LICENSE file.
  4. package main
  5. import (
  6. "crypto/tls"
  7. "path/filepath"
  8. )
  9. func loadCert(dir string) (tls.Certificate, error) {
  10. cf := filepath.Join(dir, "cert.pem")
  11. kf := filepath.Join(dir, "key.pem")
  12. return tls.LoadX509KeyPair(cf, kf)
  13. }