NewServerTLSFromFile constructs TLS credentials from the input certificate file and key file for server.
(certFile, keyFile string)
| 300 | // NewServerTLSFromFile constructs TLS credentials from the input certificate file and key |
| 301 | // file for server. |
| 302 | func NewServerTLSFromFile(certFile, keyFile string) (TransportCredentials, error) { |
| 303 | cert, err := tls.LoadX509KeyPair(certFile, keyFile) |
| 304 | if err != nil { |
| 305 | return nil, err |
| 306 | } |
| 307 | return NewTLS(&tls.Config{Certificates: []tls.Certificate{cert}}), nil |
| 308 | } |
| 309 | |
| 310 | // TLSChannelzSecurityValue defines the struct that TLS protocol should return |
| 311 | // from GetSecurityValue(), containing security info like cipher and certificate used. |