| 597 | } |
| 598 | |
| 599 | Status TlsContext::LoadCertificateAndPasswordProtectedKey(const string& certificate_path, |
| 600 | const string& key_path, |
| 601 | const PasswordCallback& password_cb) { |
| 602 | SCOPED_OPENSSL_NO_PENDING_ERRORS; |
| 603 | Cert c; |
| 604 | RETURN_NOT_OK_PREPEND(c.FromFile(certificate_path, DataFormat::PEM), |
| 605 | "failed to load certificate"); |
| 606 | PrivateKey k; |
| 607 | RETURN_NOT_OK_PREPEND(k.FromFile(key_path, DataFormat::PEM, password_cb), |
| 608 | "failed to load private key file"); |
| 609 | RETURN_NOT_OK(UseCertificateAndKey(c, k)); |
| 610 | is_external_cert_ = true; |
| 611 | return Status::OK(); |
| 612 | } |
| 613 | |
| 614 | Status TlsContext::LoadCertificateAuthority(const string& certificate_path) { |
| 615 | SCOPED_OPENSSL_NO_PENDING_ERRORS; |