diff options
author | Luke Bratch <luke@bratch.co.uk> | 2019-05-12 21:41:49 +0100 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2019-05-12 21:41:49 +0100 |
commit | 9064f7b9c347f913089bfea94d65ad3afc11ccf4 (patch) | |
tree | eb323c6c20fd000461053d44f7fc2be5fd76df50 /sockets.c | |
parent | 03b15b2a99dee16998d08e17652bb49555c8560d (diff) |
Make certificate and key file paths configurable.
Diffstat (limited to 'sockets.c')
-rw-r--r-- | sockets.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); } |