Archived
1
0
Fork 0

💡 Expolain what happens when cert files are loaded

This commit is contained in:
Simon V. Lejel 2024-02-12 17:57:40 +01:00
parent a1d17deb5f
commit 1ff5a07a1f
Signed by: sl
GPG key ID: 6544A0430A2CFFAD

View file

@ -59,13 +59,15 @@ int main() {
cout << "Creation of SSL context failed: " << getCtxError() << endl;
}
// Load certificate
// Load certificate into the context
// Returns 1 on success, otherwise check error stack
if (SSL_CTX_use_certificate_file(ctx, "./ssl/server.crt",
SSL_FILETYPE_PEM) <= 0) {
cout << "Certificate load failed: " << getCtxError() << endl;
}
// Load certificate private key
// Load certificate private key into the context
// Returns 1 on success, otherwise check error stack
if (SSL_CTX_use_PrivateKey_file(ctx, "./ssl/server.key",
SSL_FILETYPE_PEM) <= 0) {
cout << "Private key load failed: " << getCtxError() << endl;