💡 Expolain what happens when cert files are loaded
This commit is contained in:
parent
a1d17deb5f
commit
1ff5a07a1f
1 changed files with 4 additions and 2 deletions
|
@ -59,13 +59,15 @@ int main() {
|
||||||
cout << "Creation of SSL context failed: " << getCtxError() << endl;
|
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",
|
if (SSL_CTX_use_certificate_file(ctx, "./ssl/server.crt",
|
||||||
SSL_FILETYPE_PEM) <= 0) {
|
SSL_FILETYPE_PEM) <= 0) {
|
||||||
cout << "Certificate load failed: " << getCtxError() << endl;
|
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",
|
if (SSL_CTX_use_PrivateKey_file(ctx, "./ssl/server.key",
|
||||||
SSL_FILETYPE_PEM) <= 0) {
|
SSL_FILETYPE_PEM) <= 0) {
|
||||||
cout << "Private key load failed: " << getCtxError() << endl;
|
cout << "Private key load failed: " << getCtxError() << endl;
|
||||||
|
|
Reference in a new issue