diff --git a/lib/hub.c b/lib/hub.c index da92491..944173d 100644 --- a/lib/hub.c +++ b/lib/hub.c @@ -830,7 +830,7 @@ int _sxhub_settls_ctx_s(sxhub_t *hub) /* set the local certificate from CertFile */ if(SSL_CTX_use_certificate_file(hub->ctx, hub->certpem, SSL_FILETYPE_PEM) <= 0) return SXE_ESSL; /* set the private key from KeyFile (may be the same as CertFile) */ - if(SSL_CTX_use_PrivateKey_file(hub->ctx, hub->certpem, SSL_FILETYPE_PEM) <= 0) return SXE_ESSL; + if(SSL_CTX_use_PrivateKey_file(hub->ctx, hub->certkey, SSL_FILETYPE_PEM) <= 0) return SXE_ESSL; /* verify private key */ if (!SSL_CTX_check_private_key(hub->ctx)) return SXE_ESSL;