summaryrefslogtreecommitdiff
path: root/sockets.c
diff options
context:
space:
mode:
Diffstat (limited to 'sockets.c')
-rw-r--r--sockets.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sockets.c b/sockets.c
index fd733b8..0f78b21 100644
--- a/sockets.c
+++ b/sockets.c
@@ -151,16 +151,16 @@ SSL_CTX *create_context() {
return ctx;
}
-void configure_context(SSL_CTX *ctx) {
+void configure_context(SSL_CTX *ctx, char *certfile, char *keyfile) {
SSL_CTX_set_ecdh_auto(ctx, 1);
/* Set the key and cert */
- if (SSL_CTX_use_certificate_file(ctx, "cert.pem", SSL_FILETYPE_PEM) <= 0) {
+ if (SSL_CTX_use_certificate_file(ctx, certfile, SSL_FILETYPE_PEM) <= 0) {
ERR_print_errors_fp(stderr);
exit(EXIT_FAILURE);
}
- if (SSL_CTX_use_PrivateKey_file(ctx, "key.pem", SSL_FILETYPE_PEM) <= 0 ) {
+ if (SSL_CTX_use_PrivateKey_file(ctx, keyfile, SSL_FILETYPE_PEM) <= 0 ) {
ERR_print_errors_fp(stderr);
exit(EXIT_FAILURE);
}